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

To set all checkboxes to true using JavaScript?
To set all checkboxes to true using JavaScript? //select all input tags function SelectAll() { var checkboxes = document.getElementsByTagName( "input");for(i=0;i&lt;checkboxes.le ngth;i++){ if(checkboxes.item(i).attribut es["type"].value== "checkbox") { checkboxes.item(i).checked = true; } } }
2008-11-11, 4365👍, 0💬

How to put a close window link on a page?
How to put a "close window" link on a page? &lt;a href='javascript:window.close( )'class='mainnav'> Close &lt;/a>
2008-10-07, 4363👍, 0💬

What’s a quick way to append a value to an array?
What’s a quick way to append a value to an array? arr[arr.length] = value;
2008-10-28, 4358👍, 0💬

What does JavaScript null mean?
What does JavaScript null mean? The null value is a unique value representing no value or no object. It implies no object, or null string, no valid boolean value, no number and no array object.
2008-10-21, 4357👍, 0💬

What is variable typing in JavaScript?
What is variable typing in JavaScript? It is perfectly legal to assign a number to a variable and then assign a string to the same variable as in the following example: i = 10; i = "string"; This is called variable typing
2008-11-25, 4348👍, 0💬

You have an ASP.NET web application running on a web-farm ...
You have an ASP.NET web application running on a web-farm that does not use sticky sessions - so the requests for a session are not guaranteed to be served the same machine. Occasionally, the users get error message Validation of viewstate MAC failed. What could be one reason that is causing this er...
2008-11-11, 4337👍, 0💬

How to Accessing HTML Elements using javascript?
How to Accessing HTML Elements using javascript? To do something interesting with HTML elements, we must first be able to uniquely identify which element we want. In the example below: &lt;body> &lt;form action=""> &lt;input type="button" id="useless" name="mybutton" value="doNothing" />...
2010-11-23, 4323👍, 0💬

How to hide JavaScript code from old browsers that does not support JavaScript?
How to hide JavaScript code from old browsers that does not support JavaScript? Use the below specified style of comments: &lt;script language=javascript> &lt;!-- javascript code goes here // --&gt; &lt;/script> or Use the &lt;NOSCRIPT> and &lt;/NOSCRIPT> tags and code the di...
2008-10-07, 4321👍, 0💬

How to create an input box?
How to create an input box? prompt("What is your temperature?");
2009-01-13, 4316👍, 0💬

How to set the cursor to wait?
How to set the cursor to wait? In theory, we should cache the current state of the cursor and then put it back to its original state. document.body.style.cursor = 'wait'; //do something interesting and time consuming document.body.style.cursor = 'auto';
2009-02-10, 4314👍, 0💬

What's the Date object using JavaScript?
What's the Date object using JavaScript? Time inside a date object is stored as milliseconds since Jan 1, 1970. new Date(06,01,02) // produces "Fri Feb 02 1906 00:00:00 GMT-0600 (Central Standard Time)" new Date(06,01,02).toLocaleString( )// produces "Friday, February 02, 1906 00:00:00" new Date(06,...
2009-03-03, 4297👍, 0💬

What is the difference between an alert box and a confirmation box?
What is the difference between an alert box and a confirmation box? An Alert box displays only one button which is the OK button, whereas a Confirm box displays two buttons namely OK and Cancel.
2010-10-26, 4284👍, 0💬

How to comment JavaScript code?
How to comment JavaScript code? Use // for line comments and /* */ for block comments
2008-10-14, 4281👍, 0💬

What are undefined and undeclared variables?
What are undefined and undeclared variables? Undeclared variables are those that are not declared in the program (do not exist at all), trying to read their values gives runtime error. But if undeclared variables are assigned then implicit declaration is done . Undefined variables are those that are...
2008-12-02, 4276👍, 0💬

How to have the status line update when the mouse goes over a link?
How to have the status line update when the mouse goes over a link? &lt;a href="javascript.shtml" onmouseover="window.status='Hi There!';return true" onmouseout="window.status='';r eturntrue">Look at the Status bar&lt;/a> Look at the Status bar as your cursor goes over the link.
2008-12-30, 4262👍, 0💬

What is === operator?
What is === operator? ==== is strict equality operator, it returns true only when the two operands are having the same value without any type conversion.
2008-12-09, 4259👍, 0💬

How to create a confirmation box?
How to create a confirmation box? confirm("Do you really want to launch the missile?");
2009-01-06, 4254👍, 0💬

How to test for bad numbers using JavaScript?
How to test for bad numbers using JavaScript? The global method, "isNaN()" can tell if a number has gone bad. var temperature = parseFloat(myTemperatureWidget .value);if(!isNaN(temperature)) { alert("Please enter a valid temperature."); }
2009-02-25, 4238👍, 0💬

How to convert a string to a number using JavaScript?
How to convert a string to a number using JavaScript? You can use the parseInt() and parseFloat() methods. Notice that extra letters following a valid number are ignored, which is kinda wierd but convenient at times. parseInt("100") ==&gt; 100 parseFloat("98.6") ==&gt; 98.6 parseFloat("98.6 ...
2009-02-17, 4237👍, 0💬

What’s relationship between JavaScript and ECMAScript?
What’s relationship between JavaScript and ECMAScript? ECMAScript is yet another name for JavaScript (other names include LiveScript). The current JavaScript that you see supported in browsers is ECMAScript revision 3.
2010-05-18, 4211👍, 0💬

How to add new elements dynamically.
How to add new elements dynamically. &lt;html xmlns="http://www.w3.org/1999/ xhtml"xml:lang="en" lang="en"> &lt;head> &lt;title>t1&lt;/title >&lt;script type="text/javascript"> function addNode() { var newP = document.createElement("p"); var textNode = document.createTextNode(" I...
2008-12-23, 4198👍, 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.
2008-12-02, 4192👍, 0💬

What is JavaScript?
What is JavaScript? JavaScript is a platform-independent, event-driven, interpreted client-side scripting and programming language developed by Netscape Communications Corp. and Sun Microsystems. JavaScript is a general-purpose programming language designed to let programmers of all skill levels con...
2010-05-11, 4188👍, 0💬

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, 4182👍, 0💬

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