Can multiple HTML elements have the same ID if they\'re of different element types? Is a scenario like this valid? Eg:
div#foo span#foo a#foo
We can use class name instead of using id. html id are should be unique but classes are not. when retrieving data using class name can reduce number of code lines in your js files.
$(document).ready(function () { $(".class_name").click(function () { //code }); });