Do getElementsByClassName (and similar functions like getElementsByTagName and querySelectorAll) work the same as getElementById or do they return an array of elements?  The reason I ask is because I am trying to change the style of all elements us...
The following code:  var borderTds = document.getElementsByClassName('leftborder');   gives me an error message in Internet Explorer 6, 7 and 8:      Object does not support this method   How can I select elements by their class in these br...
I can add many rows for a table, but I can't remove many rows. I only can remove 1 row per sequential add.  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> $(document).ready(fu...
HTML:  <ul id="datalist"> </ul>   JavaScript:  function add(content){    ul=document.getElementsByTagName("ul");    var li=document.createElement("li");    li.innerHTML=content;    ul.appendChild(li); }   When I ca...
You can get the nodes of the document object of an <iframe> with the contentDocument property of the HTMLIFrameElement  But I can't find a way getting the <iframe> back out of the node. Is the relation between the <iframe> and i...
I'm trying to replace all text in between tags and I want to know the fastest way of doing so.   An example would be trying to replace all text with the arbitrary string helloWorld, so that this:   <div>     <div>         RandomText1...
<div id="main">  <div class="a"></div>  <div class="b"><p>not me</p></div>  <div class="b"></div>  <div class="b"></div>  <div class="c&#...
im trying to find out how to see if an error is returned from an AJAX request. for testing the request always returns <p id="error">test</p>  I thought you could do it like this:  //html is the var which contains the result var DO...
I'd like to be able to walk up the DOM from inside one or more nested iframes to grab and empty the parent div of the top iframe. I'd like my JS to work if there's just one iframe, or if there are two.  I have a main page with this iframe...
Let's say I have many of these in my content div : <cite class="fn">blabla</cite>  How can I check every cite tag's content (in this case: blabla) with class fn to see if it equals to "sometext" then change it'...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.