how to add javascript to html page

Posted by user1888584 on Stack Overflow See other posts from Stack Overflow or by user1888584
Published on 2012-12-11T22:36:32Z Indexed on 2012/12/11 23:03 UTC
Read the original article Hit count: 114

Filed under:

I was given this chunk of code to place in my html page but I know nothing about javascript so I have no idea where to place it and what kind of tag to place it in.

Can someone please help me.

Thanks

Code:

$('input[type=radio]').change(function() {

$('input[type=radio]').each(function(index) {
  $(this).closest('tr').removeClass('selected');
});

$(this).closest('tr').addClass('selected');
});

© Stack Overflow or respective owner

Related posts about JavaScript