I want to change the src of an image file. Tried the below using with the variable, but it actually doesnt change it. Where did I made a mistake on using variable ?
jquery
var p2begen = "416";
$("[id=i'" + p2begen + "']").attr("src", "check.png");
html
<img src="nocheck.png" id="i416" \>
#in$("[id=#i'" + p2begen + "']")i'416', remove those '. Also, as answered by others, the correct way to select ID is with #$('#element_id')