Click here to Skip to main content
15,898,791 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
For ex: this is a xml file(books.xml)

<book>
<Author name="erty">4546
<Author name="njkh">536
<Author name="nmkj">767
<Author name="uhdf">8746


I want to display only the element whose attribute(name) value is "erty".
How do i display that in html using javascript.

What I have tried:

I found that jquery selector and document.queryselectorAll() can be used ...but i dont know how to use these in html.

Please reply as soon as possible.
Thanks!
Posted
Updated 24-Jun-18 0:18am

1 solution

XSLT is the way to turn XML into HTML (or other formats)...
XSLT Transformation[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900