Duplicate:Cascading style sheets use "id" or "class"CSS: are interchangeable and id interchangeable?div class vs idCSS: div id VS. div class
Duplicate:
Someday, when I like to make choices, add an identifier (unique) to something (images), and I used jquery to do something on hover or click.
But the same thing can be done with classes. I understand that a class is for many things (let's say class = "selected"), but when the class adds something, I can run the jQuery action with this insted ID class ...
So the question is, what is the “right way” to use class and identifier if I can accomplish anything and everything with both!
, , , . div, , . , , .
- . JavaScript, - . ID , . , , " " . , , , , , , "", "", " " " ..
, - , HTML-.
, , . , , , , "" ID "entry",
HTML , , .
, "" - , .
:
http://example.com/mypage.htm#someid
document.getElementById('someid')
$("#someid")
document.getElementById()
Source: https://habr.com/ru/post/1705940/More articles:How to find a variable if I have its address in memory? - objective-cWii-HiFi Key Problem - SecKeychainItemRef Unannounced Error - iphoneDuplicate strings when using orderby, Skip () and Take () using LINQ - c #Finding Duplicate iPhone Applications - iphone.NET JIT assemblies in shared pages - .netHow do two or more processes interact with a keyboard? - c ++How can I fill out web forms using Perl? - perlCSS: совместимы ли классы и идентификаторы? - cssIPhone Ideas for iPhone? - iphoneIs file fragmentation of the mdf file a problem? - sql-serverAll Articles