0
   

How to get html within the '<' and the '>' using Javascript?

 
 
Reply Sat 26 Mar, 2016 01:12 am
Suppose I have the following code:
<h1>Header</h1>
<div id="identifier" class="classic" src="source" title="caption">
<p>Paragraph</p>
</div>
getElementById("identifier").innerHTML returns the string "<p>Paragraph</p>" and outerHTML returns all the html I wrote above as string too of course.

But what about the html within the '<' and '>'? This suppose to be "div id="identifier" class="classic" src="source" title="caption""

I want to get this string, but I don't find out how. I have already tried tagName, but it returns only the string "DIV". Please help!
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 673 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » How to get html within the '<' and the '>' using Javascript?
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 04/20/2024 at 03:49:00