Linked Questions
606 questions linked to/from HTML: Valid id attribute values?
1 vote
1 answer
53 views
getElementById : IE Issues [duplicate]
Having a problem with document.getElementById in IE 11 to retrive a div who has a long url as id. Example : <div id="http://localhost:8084/group/control_panel/manage?p_auth=2kVqRblu&...
-8 votes
2 answers
108 views
Impact on space on class / id [duplicate]
What will be the impact, if we add some extra space in id or class in HTML. Like if we write like this, <div class=" class1" id=" id">This is a div</div> Will the CSS ...
-2 votes
1 answer
48 views
CSS - Multiple IDs, only one is working [duplicate]
I have two html code snippets: #header { text-align: center; font-size: 14px; font-family: "Gill Sans MT"; margin-top: 30px; } #123 { text-align: center; font-size: 14px; ...
0 votes
0 answers
29 views
why inner div doesn't take css style? [duplicate]
I declared a div after header and nav, and styled it then I declared another in div inside that, now I'm trying to style this inner div but it doesn't work I don't know why here is html code <...
0 votes
0 answers
24 views
How to select an item added dynamically via createElement in JavaScript? [duplicate]
Essentially, I'm using JavaScript to add <li> tags with content inside them dynamically to a <ul>. This works fine and great, except when I try to select an element inside that <li> ...
695 votes
13 answers
754k views
document.getElementById vs jQuery $()
Is this: var contents = document.getElementById('contents'); The same as this: var contents = $('#contents'); Given that jQuery is loaded?
588 votes
13 answers
455k views
HTML input - name vs. id [duplicate]
When using the HTML <input> tag, what is the difference between the use of the name and id attributes especially that I found that they are sometimes named the same?
148 votes
11 answers
110k views
jquery IDs with spaces
Does anyone know how to select an item in the DOM by ID with jQuery, when that ID has a space? For example, the ID of my item would be <div id="content Module">Stuff</div> How would I ...
189 votes
8 answers
98k views
How do I get jQuery to select elements with a . (period) in their ID?
Given the following classes and controller action method: public School { public Int32 ID { get; set; } publig String Name { get; set; } public Address Address { get; set; } } public class ...
135 votes
8 answers
93k views
Naming "class" and "id" HTML attributes - dashes vs. underlines [closed]
<div id="example-value"> or <div id="example_value">? This site and Twitter use the first style. Facebook and Vimeo - the second. Which one do you use and why?
82 votes
13 answers
327k views
JavaScript and getElementById for multiple elements with the same ID
How can I get a collection of elements by specifying their id attribute? I want to get the name of all the tags which have the same id in the html. I want to use ONLY getElementById() to get an ...
52 votes
22 answers
64k views
How to choose between class and id
When using divs when is it best to use a class vs id? Is it best to use class, on say font variant or elements within the html? Then use id for the structure/containers? This is something I've ...
98 votes
8 answers
246k views
Bootstrap tab activation with JQuery
I have the following code: <ul class="nav nav-tabs"> <li><a href="#aaa" data-toggle="tab">AAA</a></li> <li><a href="#...
156 votes
3 answers
658k views
Jquery change background color
I was trying out jquery with this example: $(document).ready(function(){ $("button").mouseover(function(){ $("p#44.test").css("background-color","yellow"); $("p#44.test").hide(...