6
I would like to know about creating and manipulating attributes in html that are created. We have the attributes already known as the id, class, etc. that we put in the tags so we can manipulate them. I went in search of other alternatives of names, that could serve me in this order. I saw the "date-" that after the same one can put the name you want (correct me if I’m wrong here) and make such manipulation through that attribute that came with Html5. After using "date-", I checked if I could create an attribute in the tag with the name I wanted. What I did was the following:
<a href="#" data-grupo="13" numberlink="1" class="link" id="um">Link 1</a>
When I went to the element inspecter and selected the element through the attribute:
$("a[data-grupo=13]");
He found the element. With that I understood that I can create these tag attributes according to my wish. But I don’t know if this is good practice, because there may be differences of attributes for attributes like the example of class and id, in which this can only belong to one element and the one to more than one element.
I couldn’t get an answer to these questions, I couldn’t find what I wanted here in the:
Meanings of data-value, data-title, data-... attributes in HTML
Use unary HTML tags attributes with assigned value
I can name attributes of html tags according to my will without this generating me problems (in manipulation or any other use of tags or attributes)?
Your questions are usually exemplary.
– Maniero
Do you have a problem with them being like this? if I have I can try to change the way of asking :) I always try to test first, then I look here in only and on the net, when I find nothing that satisfies my doubt I ask here.
– DiChrist
Of course, it shows how the others are worse :) Of course you can always improve, but yours can’t get much better, they do everything a good question should ask. Congratulations!
– Maniero
Related: http://meta.pt.stackoverflow.com/questions/4829/eu-n%C3%a3o-sei-perguntar-e-voc%C3%aa? cb=1 :D
– gustavox
vlw bigown! obg!
– DiChrist