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

Reply Sat 26 Mar, 2016 01:12 am
Suppose I have the following code:
<div id="identifier" class="classic" src="source" title="caption">
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: 551 • Replies: 0
No top replies


Related Topics

How does one uninstall a program? - Question by Woollcott
Adding a JavaScript 'Copy to Clipboard' - Discussion by BobbyDouglas
JavaScript: OnSelect question - Discussion by neocode
Javascript - Control C textarea script - Discussion by Craven de Kere
2018123 - Question by ibk1995
javascript loops for - Question by vartul agnihotri
  1. Forums
  2. » How to get html within the '<' and the '>' using Javascript?
Copyright © 2021 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 07/25/2021 at 12:13:01