如果我的标识符id=cu:w
中有冒号,我怎么能用jQuery选择它?
$(function() {
$('#cu:w').on('change', function() {
$(this).hide();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<fieldset>
<legend>Check Here
<input id='cu:w' type="checkbox">
</legend>
<span class="myClass">
<p>This is the text.</p>
</span>
</fieldset>
答案 0 :(得分:2)
答案 1 :(得分:2)