@*前台*@
<input type="text" name="name" id="asd" oninput="a()" class="form-control" value="" />
@*获取前台值*@
<a href="#" onclick="abc('123')" class="btn btn-primary">选中</a>
@*js事件*@
<script type="text/javascript">
function a() {
var aaaa = document.getElementById("asd");
document.getElementById("aaa").innerHTML = aaaa.value;
}
function abc(username) {
document.getElementById("name").innerHTML = username;
}
@*label获取选中值*@
function abc(username) {
document.getElementById("name").innerHTML = username;
}
</script>
input输入内容改变lable值 oninput事件
最新推荐文章于 2024-03-19 10:28:51 发布