
Stanley W. answered 04/09/19
Help is a click away.
The id field could be used by languages like JavaScript and PHP to give your web application more functionality.
Stanley W. answered 04/09/19
Help is a click away.
The id field could be used by languages like JavaScript and PHP to give your web application more functionality.
Diane J. answered 04/09/19
Experienced Tutor specializing in HTML and CSS coding
Name has a specific use for 'named anchors' - A named anchor is a link to content within the current resource. A typical named anchor will be similar to: <a name="prohibited"></a>.
An 'id' is a unique identifier that you add to an html element, so you can add CSS to it, or interact with it via JavaScript.
One reason you might name these the same (there may be other reasons), as it's makes it easier to remember when you are implementing the code. For example, you might have a section in your code for 'quick links', and then you place that content in a <div id="quickLinks"> </div>. If you want to jump to that particular section in the page, you would add a named anchor to that element ,<div id="quickLinks" name="quickLinks"></div>, and then you could link to it like this: https://www.mywebsite.org#quickLinks.
I hope this helps.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.