で要素を選択すると、これは私にとって奇妙ですid
。jqueryコードは機能しませんが、それを選択するclassname
とうまく機能します!
このコード:
<input name='daneshjou_number' class='daneshjou_number' type='text' >
このコードは機能します:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".is_daneshjou").change(function(){
//alert("The text has been changed.");
$(".daneshjou_number").prop('readonly', true);
});
});
</script>
しかし、このコードは機能しません:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".is_daneshjou").change(function(){
//alert("The text has been changed.");
$("#daneshjou_number").prop('readonly', true);
});
});
</script>