
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
How to get the value of the type attribute of a link in JavaScript?
To get the value of the type attribute of a link in JavaScript, use the type property. The type attribute is used to tell that the document is html (text/html) or css (text/css), etc.
Example
You can try to run the following code to get the value of the type attribute of a link.
<!DOCTYPE html> <html> <body> <p><a id="anchorid" type="text/html" target= "_blank" href="https://www.qries.com/">Qries</a></p> <script> var myVal = document.getElementById("anchorid").type; document.write("Value of type attribute: "+myVal); </script> </body> </html>
- Related Articles
- How to search the value of the type attribute of a link in JavaScript?
- How to get the value of the id attribute a link in JavaScript?
- How to get the value of the hreflang attribute of a link in JavaScript?
- How to get the value of the rel attribute of a link in JavaScript?
- How to get the value of the target attribute of a link in JavaScript?
- How to search the value of the href attribute of a link in JavaScript?
- How to search the value of the target attribute of a link in JavaScript?
- How to get the value of the usemap attribute in JavaScript?
- How to get an attribute value from a href link in selenium?
- How to find the href attribute of a link in a document in JavaScript?
- How to get the value of the usemap attribute of an image with JavaScript?
- How to get the value of id attribute in jQuery?
- How to get the value of src attribute in jQuery?
- How to get the value of custom attribute in jQuery?
- How to change the value of an attribute in javascript?

Advertisements