我有table
可编辑。我希望在div
内容更改时更改td
宽度。我认为我的jQuery代码不起作用。我该如何解决这个问题?
var form = document.getElementById('form');
number = document.getElementById('number');
form.onchange = function() {
var variable = number.value;
var unit = "px";
var z = variable + unit;
$("#check").css("width", z);
};

#check {
background-color: red;
height: 15px;
width: 200px;
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<td>
<form id="form">
<input id="number" type="number" min="1" name="number">
</form>
<div id="check"></div>
</td>
</tr>
</table>
&#13;
答案 0 :(得分:0)
您可以在 Notification noti = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();
和keyup
change
var form = document.getElementById('form');
number = document.getElementById('number');
$("#number").on("keyup change",function() {
var variable = number.value;
var unit = "px";
var z = variable + unit;
$("#check").css("width", z);
});
#check {
background-color: red;
height: 15px;
width: 200px;
}