javascript - Check if an HTML element with the same id exists -


can done using javascript?

if you're trying find out if more 1 element share 1 id, jquery $('[id=blah]').length - return count of elements id equal 'blah'. see the fiddle. if it's greater 1 have duplicate id.

edit: i've tested in chrome, ff , ie6, , of them show there 2 elements same id. agree it's bad form have more 1 element share id, code work.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -