1
I can set ids
and classes in style
, script
, etc.?
Example:
<style class="teste" id="teste">
/*
Meu codigo aqui
*/
</style>
1
I can set ids
and classes in style
, script
, etc.?
Example:
<style class="teste" id="teste">
/*
Meu codigo aqui
*/
</style>
1
You can. Whenever you have doubt you can consult the MDN which is considered the official documentation. It contains all the attributes that each tag allows. In the case of both tags allow these attributes because they are part of the global attributes.
1
You can, you’ve already tested?
Example below.
document.getElementById('teste-style').innerHTML = 'p{color: #e41;}';
document.getElementById('teste-script').innerHTML = 'alert("Foo!");';
<style class="teste" id="teste-style">
/*
Meu codigo aqui
*/
</style>
<script id="teste-script"></script>
<p>Texto aqui!</p>
Browser other questions tagged html html5
You are not signed in. Login or sign up in order to post.