0
このコードは、すべてのテキストボックスに値0の最後のテキストボックスにフォーカスしてダイナミックテキストボックスを作成します。ここで作成した動的jqueryを使用して最後に作成したダイナミックテキストボックスのフォーカスに動的に値を追加
<html>
<head>
<script> src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"> </script>
<script>
$(document).ready(function(){
$("input").on('focus' , addNew);
function addNew(){
if($(this).is(':last')){
$(this).after('<input type="text" value="0"/>');
$("input").on('focus' , addNew);
}
}
});
</script>
</head>
<body>
<script>
var divBox1 = document.createElement("div");
divBox1.style.height = "100%";
divBox1.style.width = "200px";
document.body.appendChild(divBox1)
var input = document.createElement('input');
divBox1.appendChild(input);
</script>
</body>
</html>
..だから問題は何ですか? –
動的値のソースは何ですか? –
http://stackoverflow.com/users/4417952/keyur-shah http://stackoverflow.com/users/3639582/shaunak-d ....私はそれを感謝した – Harinath