<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Date

How to find radio button selection when a form is submitted?
How to find radio button selection when a form is submitted? &lt;script type="text/javascript"> function findButton() { var myForm = document.forms.animalForm; var i; for (i=0;i&lt;myForm.marsupial .length;i++) { if (myForm.marsupial[i].checked) { break; } } alert("You selected \""+myForm.ma...
2008-12-16, 4193👍, 0💬

Name the numeric constants representing max, min values
Name the numeric constants representing max, min values Number.MAX_VALUE Number.MIN_VALUE
2008-10-14, 4182👍, 0💬

How to convert numbers to strings using JavaScript?
How to convert numbers to strings using JavaScript? You can prepend the number with an empty string var mystring = ""+myinteger; or var mystring = myinteger.toString(); You can specify a base for the conversion, var myinteger = 14; var mystring = myinteger.toString(16); mystring will be "e".
2009-02-25, 4159👍, 0💬

How to disable an HTML object
How to disable an HTML object document.getElementById("myObj ect").disabled= true;
2008-12-16, 4154👍, 0💬

How to open a window with no toolbar, but with the location object.
How to open a window with no toolbar, but with the location object. window.open("http://www.mysite .org/Misc/Pennies","Pennies"," resizable=yes,status=yes,toolbar=yes,locatio n=yes,menubar=yes,scrollbars=y es,width=800,height=400");
2009-01-13, 4149👍, 0💬

How to get values from cookies to set widgets?
How to get values from cookies to set widgets? function getCookieData(labelName) { //from Danny Goodman var labelLen = labelName.length; // read cookie property only once for speed var cookieData = document.cookie; var cLen = cookieData.length; var i = 0; var cEnd; while (i &lt; cLen) { var j = ...
2009-01-20, 4137👍, 0💬

How to find the selected radio button immediately using the this variable?
How to find the selected radio button immediately using the 'this' variable? &lt;script> function favAnimal(button) { alert('You like '+button.value+'s.'); } &lt;/script> &lt;input type="radio" name="marsupial" value="kangaroo" onchange="favAnimal(this)">Kan garoo&lt;br />&lt;inp...
2008-12-09, 4132👍, 0💬

What is the difference between RegisterClientScriptBlock and RegisterStartupScript?
What is the difference between RegisterClientScriptBlock and RegisterStartupScript? RegisterClientScriptBlock emits the JavaScript just after the opening &lt;form> tag. RegisterStartupScript emits the JavaScript at the bottom of the ASP.NET page just before the closing &lt;/form> tag.
2010-10-05, 4131👍, 0💬

What's Math Constants and Functions using JavaScript?
What's Math Constants and Functions using JavaScript? The Math object contains useful constants such as Math.PI, Math.E Math also has a zillion helpful functions. Math.abs(value); //absolute value Math.max(value1, value2); //find the largest Math.random() //generate a decimal number between 0 and 1 ...
2009-03-03, 4125👍, 0💬

How to have an element invoke a JavaScript on selection, instead of going to a new URL
How to have an element invoke a JavaScript on selection, instead of going to a new URL &lt;script type="text/javascript"> function pseudoHitMe() { alert("Ouch!"); } &lt;/script> &lt;a href="javascript:pseudoHitMe() ">hitme&lt;/a>
2008-12-30, 4115👍, 0💬

How to change style on an element?
How to change style on an element? Between CSS and javascript is a weird symmetry. CSS style rules are layed on top of the DOM. The CSS property names like "font-weight" are transliterated into "myElement.style.fontWeight". The class of an element can be swapped out. For example: document.getElement...
2009-02-03, 4107👍, 0💬

How to write messages to the screen without using "document.write()"?
How to write messages to the screen without using "document.write()"? Changing the contents of an element is a much better solution. When the method showStatus is invoked, it will change the content of the span. ... function showStatus(message) { var element = document.getElementById("mysta tus");el...
2011-02-15, 4081👍, 0💬

What are JavaScript data types?
What are JavaScript data types? Number, String, Boolean, Function, Object, Null, Undefined.
2010-06-15, 4068👍, 0💬

How to associate functions with objects using JavaScript?
How to associate functions with objects using JavaScript? Let's now create a custom "toString()" method for our movie object. We can embed the function directly in the object like this. &lt;script type="text/javascript"> function movie(title, director) { this.title = title; this.director = direc...
2011-08-09, 4014👍, 0💬

What does the "Access is Denied" IE error mean?
What does the "Access is Denied" IE error mean? The "Access Denied" error in any browser is due to the following reason. A JavaScript in one window or frame is tries to access another window or frame whose document's domain is different from the document containing the script.
2010-08-31, 3986👍, 0💬

How to get the contents of an input box using JavaScript?
How to get the contents of an input box using JavaScript? Use the "value" property of the input box object. For example: var myValue = window.document.getElementById ("MyTextBox").value;
2010-10-12, 3984👍, 0💬

What is the difference unescape() and escape()?
What is the difference unescape() and escape()? These are similar to the decodeURI() and encodeURI(), but escape() is used for only portions of a URI: &lt;script type="text/javascript"> var myvalue = "Sir Walter Scott"; document.write("Original myvalue: "+myvalue); document.write("&lt;br />e...
2011-08-23, 3980👍, 0💬

What is negative infinity?
What is negative infinity? It’s a number in JavaScript, derived by dividing negative number by zero.
2010-08-10, 3948👍, 0💬

How do you submit a form using Javascript?
How do you submit a form using Javascript? Use document.forms[0].submit(); (0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).
2010-05-18, 3931👍, 0💬

How do we get JavaScript onto a web page?
How do we get JavaScript onto a web page? You can use several different methods of placing JavaScript in you pages. You can directly add a script element inside the body of page. 1. For example, to add the "last updated line" to your pages, In your page text, add the following: &lt;p>blah, blah,...
2010-06-02, 3910👍, 0💬

What looping structures are there in JavaScript?
What looping structures are there in JavaScript? for, while, do-while loops, but no foreach.
2010-11-30, 3889👍, 0💬

Does JavaScript have the concept level scope?
Does JavaScript have the concept level scope? No. JavaScript does not have block level scope, all the variables declared inside a function possess the same level of scope unlike c, c++, and java.
2011-01-25, 3885👍, 0💬

nodeList is almost like an array except:
nodeList is almost like an array except: A) it has an item method. B) it is read-only. C) both a and b above. D) none of the above.
2010-08-28, 3872👍, 0💬

How is JavaScript different from Java?
How is JavaScript different from Java? JavaScript was developed by Brendan Eich of Netscape; Java was developed at Sun Microsystems. While the two languages share some common syntax, they were developed independently of each other and for different audiences. Java is a full-fledged programming langu...
2010-05-11, 3812👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Date