I checked all the topics, but i simply don't know why my script does not work :(
<script type="text/javascript">
$('input[name=pic]').click(function() {
$(this).closest('ul').find(".green").removeClass("green");
if($(this).is(':checked')) {
$(this).closest('ul').find("li").addClass('green');
}
});
</script>
another script what is making the li tags
var link = document.createElement('li');
var parts = result.tbUrl.split('::');
link.innerHTML = "<label for='asd"+i+"'><img src='"+result.tbUrl+"' /></label><br /><input id='asd"+i+"' type='radio' name='pic' value='http://"+parts[1]+"' />";
contentDiv.appendChild(link);
etc...
<ul>
<li><input type="radio" name="pic" value="asd"/>asd</li>
<li><input type="radio" name="pic" value="b"/>asd</li>
<li><input type="radio" name="pic" value="ba"/>asd</li>
<li><input type="radio" name="pic" value="bs"/>asd</li>
<li><input type="radio" name="pic" value="bc"/>asd</li>
</ul>
Please help me!