I am trying to get all elements with an id starting with some value. Below is my jQuery code. I am trying to use a JavaScript variable when searching for items. But it does not work. What am I missing below? So the id 'value' am searching is the value of the clicked element
$(document).ready(function() {
$('input[name$="_chkmulti"]').click(function(){
var value = $(this).val();
$("td[id^= + value +]").each(function(){
alert("yes");
});
});
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…