How can I reference the script element that loaded the javascript that is currently running?  Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD tag.  <!DOCTYPE html PUBLIC "-...
How do you test an element for existence without the use of the getElementById method? I have setup a live demo for reference. I will also print the code on here as well:  <!DOCTYPE html> <html> <head>     <script>     var g...
I have been trying to add onclick event to new elements I added with JavaScript.  The problem is when I check document.body.innerHTML I can actually see the onclick=alert('blah') is added to the new element.  But when I click that element I...
Is there any difference between these solutions?  Solution 1:    function doSomething(id, value) {   console.log(value);   //... } <input id="theId" value="test" onclick="doSomething(this.id, this.value)" />     ...and...
I am looking for a way to wrap, with jQuery, an element into a comment, like:  <!-- <div class="my_element"></div> -->   and also a way to remove the comments.  Is this possible?...
Are there ways for me to listen for onblur or onclick events in javascript from an onload function? instead of doing it in the element itself.  <input type="button" id="buttonid" value="click" onclick="func()">...
<div id="main"> <p>Text1</p> <p>Text2</p> <p>Text3</p> </di>   Result should be :  ["text1","text2","text3"]...
Are there general reasons not to deal with Document's and Element's prototype?  I like to create my own little framework, because my current project doesn't need the mass of features of the existing frameworks.  I don't need to suppor...
I would like to create a new function that I can use on elements, like this:  document.getElementById("element").myNewFunction();   I'm not talking about this:  document.getElementById("element").myNewFunction = function(){    doS...
I am trying to implement a simple fold/unforld effect for elastic div's, i.e. when actual dimensions of an element are not set through CSS and thus are not trivially determinable. So I need equivalents of jQuery's width() and height() for arb...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.