当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - how to call selector in js $('.tncSelect').click(function() .. its working when i call alert?

问题描述:

$(function() { //alert('hello');

$('.tncSelect').click(function() {

if ($(this).is(":checked")) {

var s = "=> " + $(this).val();

document.getElementById('cntr-terms').value += s.substring(s.length - 500) + '\n';

//$("#cntr-terms").val(s);

}

});

});

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<input type="checkbox" name="optradio" id="someUniqeu" class="tncSelect" value="hello">

<textarea class="form-control" id="cntr-terms" rows="10" placeholder="الشرح ..."></textarea>

分享给朋友:
您可能感兴趣的文章:
随机阅读: