In the past and with most my current projects I tend to use a for loop like this:  var elements = document.getElementsByTagName('div'); for (var i=0; i<elements.length; i++) {     doSomething(elements[i]); }   I've heard that using a...
I have a page with anchor tags throughout the body like this:  <a id="test" name="Name 1"></a> <a id="test" name="Name 2"></a> <a id="test" name="Name 3"></a>   The...
I got this div...  <div tabindex="0" class="button-base inline-block button aw-btn button-base-active">     <input type="text" tabindex="-1" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflo...
I'm trying to create a continually rotating banner for the top of the homepage of a site I'm developing. The best way that I can figure to keep it constantly in rotation is to take the first DIV (firstChild) and move it to the end of the stac...
For the example, I'm trying to replace  <script type='text/javascript'>some stuff</script>   with:  <div type='text/javascript'>some stuff</div>   I'm currently testing with:  alert( o.replace( /(?:<...
This is probably something quite easy to resolve, but for some reason, I can't figure it out.  I have the following HTML:  <li onclick="function_1();">   <input type="checkbox" onclick="function_2();">   <di...
My situation  var domElements = document.body.getElementsByTagName('*');   Now I want to return the array item key - position of the element in the array - ( for example domElements[34]) searching in the array for the element with id="asd...
I am using WebDriverIO to try to access (ie. getText, getAttribute, click, etc) an element after creating a list of elements. I am easily able to implement this element if I am using the browser.element() method, but the moment I use browser.elements...
I have a few elements with identical class names.  How can I get the number of the elements which I clicked with onclick events?  For example:  var x = document.getElementsByClassName("myclass").length;  for (a=0; a<=x; a++) {      // here...
I'm building 10 buttons on the DOM and want to see if there is a more efficient way of building them because it seems strange to be calling createElement and appendChild 10 times.   <script> function makeAlertButtons () {   var container =...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.