outerhtml Questions

9

Solved

I would like to retrieve a certain tag element with its attributes from the DOM. For example, from <a href="#" class="class"> link text </a> I want to get <a href="#" class="clas...
Barbee asked 7/3, 2012 at 15:25

4

I'm trying to replace video links inside a string - here's my code: $doc = new DOMDocument(); $doc->loadHTML($content); foreach ($doc->getElementsByTagName("a") as $link) { $url = $link-&g...
Preshrunk asked 23/3, 2011 at 12:3

5

Solved

I try to get the outer HTML in two different ways, based on this question. Unfortunately, none of them is giving the expected result: HTML: <div id='my_div'>Hello</div> JS: $(funct...
Digression asked 19/9, 2010 at 14:13

1

Solved

Resetting outerHTML property of document.body has a strange side effect: it adds extra empty <head></head> into the DOM, just before body: head { display: inline; counter-increment...
Passable asked 19/10, 2018 at 8:13

3

Solved

My code gets JSON from an Ajax call, which contains XML, and goes through it reading some information. Although the parsing of the XML runs fine in Chrome, it does not in IE, since in IE outerHTML...
Capitalize asked 28/7, 2017 at 14:25

5

Solved

Why can not we get outerHTML of an svg element with element.outerHTML property? Is this way is the best http://jsfiddle.net/33g8g/ for getting svg source code?
Dunant asked 25/9, 2012 at 23:12

1

Solved

I create a generic element by var element = document.createElement(null); document.body.appendChild(element); after which, the element is altered by using outerHTML element.outerHTML = "<div...
Synthesize asked 31/1, 2017 at 8:44

2

Solved

I have a jsfiddle here - http://jsfiddle.net/stevea/QpNbu/3/ - that collects the outerHTML for all elements that have class='active'. What amazes me is that even if I comment out some of the HTML, ...
Allomerism asked 13/7, 2013 at 2:0

6

Solved

Starting to implement Javascript, I need to do troubleshooting and would like to output HTML to the screen without it being rendered. I can access the element (in IE) by document.getElementById("t...
Otoplasty asked 2/6, 2011 at 22:21

3

What are the differences between when you should use innerHTML and outerHTML. And how would you best implement the outerHTML to replace or add content?
Sphygmoid asked 20/3, 2010 at 14:43
1

© 2022 - 2024 — McMap. All rights reserved.