i have the following javascript below after i finish an ajax query
all of my images have name="pic"
<script type="text/javascript">
function done() {
var e = document.getElementsByName("pic");
alert(e.length);
for (var i = 0; i < e.length; i++) {
cvi_instant.add(e[i], { shadow: 75, shade: 10 });
}
}
m...
If I have the following HTML:
<div id="container">
<iframe></iframe>
</div>
What is the most effective way (mainly in terms of performance) to create a reference to the <iframe> DOM element? I'm using something like the following:
var element = document.getElementById('container').getElementsByTagName('iframe')[0];
IIRC, though, ...
Why doesn't the following code work?
var f = document.getElementsByTagName;
var x = f('div');
I get "TypeError: Illegal invocation" in Chrome, "TypeError: Type error" in Safari. I don't get an error in Firefox, but it doesn't work. I haven't bothered testing in IE or Opera yet.
...
I have the following JSON:
var json = {
"system" : {
"world" : {
"actions" : {
"hello" : {
"src" : "hello world/hello world.js",
"command" : "helloWorld"
}
}
}
}
}
I have the following javasc...
Looking for the best, standards compliant, cross browser compatible, forwards compatible way to access a group of radio buttons in the DOM (this is closely related to my other most recent post...), without the use of any external libraries.
<input type="radio" value="1" name="myRadios" />One<br />
<input type="radio" value="2" name="myR...
<script type='text/javascript'>
function formValidator(){
// Make quick references to our fields
var username = document.getElementByName('username');
var password = document.getElementByName('password');
var email = document.getElementByName('email');
// Check each input in the order that it appears in the form!
if(isAlphanumeric(u...
I need to show/hide multiple elements with the same name when another element is clicked, like
<span name="showhide" value="one" id="button">Click to Hide One</span>
<span name="showhide" value="two" id="button">Click to Hide Two</span>
<span name="showhide" value="shoe" id="button">Click to Hide shoe</span>
would hide the elements with ...