<< < 4 5 6 7 8 9 10 >   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; } } }
2011-01-11, 3689👍, 0💬

How to access an external JavaScript file that is stored externally and not embedded?
How to access an external JavaScript file that is stored externally and not embedded? This can be achieved by using the following tag between head tags or between body tags. &lt;script src="MyScripts.js">&lt;/sc ript>where MyScripts.js is the external JavaScript file to be accessed.
2010-10-26, 3681👍, 0💬

What is the data types of variables of in JavaScript?
What is the data types of variables of in JavaScript? Number, String, Boolean, Function, Object, Null, Undefined.
2010-08-17, 3681👍, 0💬

How to use "join()" to create a string from an array using JavaScript?
How to use "join()" to create a string from an array using JavaScript? "join" concatenates the array elements with a specified seperator between them. &lt;script type="text/javascript"> var days = ["Sunday","Monday","Tuesday"," Wednesday","Thursday","Friday","Saturday" ];document.write("days:"+d...
2011-07-26, 3678👍, 0💬

What are the ways to emit client-side JavaScript from server-side code in ASP.NET?
What are the ways to emit client-side JavaScript from server-side code in ASP.NET? The Page object in ASP.NET has two methods that allow emitting of client-side JavaScript: RegisterClientScriptBlock and RegisterStartupScript. Example usage: Page.RegisterClientScriptBlock ("ScriptKey","&lt;script...
2010-10-05, 3676👍, 0💬

How to use strings as array indexes using JavaScript?
How to use strings as array indexes using JavaScript? Javascript does not have a true hashtable object, but through its wierdness, you can use the array as a hashtable. &lt;script type="text/javascript"> var days = ["Sunday","Monday","Tuesday"," Wednesday","Thursday","Friday","Saturday" ];for(va...
2011-07-19, 3670👍, 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...
2011-02-22, 3654👍, 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,...
2011-07-05, 3652👍, 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 ...
2011-06-21, 3631👍, 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".
2011-06-21, 3621👍, 0💬

How do you assign object properties?
How do you assign object properties? obj["age"] = 17 or obj.age = 17.
2010-12-21, 3604👍, 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...
2011-02-08, 3600👍, 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>
2011-02-22, 3587👍, 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...
2011-02-01, 3573👍, 0💬

How to embed JavaScript in a web page?
How to embed JavaScript in a web page? javascript code can be embedded in a web page between &lt;script langugage="javascript"> your scripts here &lt;/script> tags.
2010-09-14, 3571👍, 0💬

How do you target a specific frame from a hyperlink?
How do you target a specific frame from a hyperlink? Include the name of the frame in the target attribute of the hyperlink. &lt;a href=”mypage.htm” target=”BodyFrame”>>Next&l t;/a>
2010-06-29, 3548👍, 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."); }
2011-06-28, 3512👍, 0💬

Can JavaScript code be broken in different lines?
Can JavaScript code be broken in different lines? Breaking is possible within a string value by using a backslash \ at the end of the line. But this technique can not be used within any other values. For example: document.write("Hello \ world");
2010-11-02, 3509👍, 0💬

When is the following statement true?
When is the following statement true? if (day = " 26 ") a) When the variable age equals 26 b) This statement is never true c) This stattement is always true d) If it is the twenty sixth day of the month
2010-08-28, 3491👍, 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 ...
2011-07-05, 3467👍, 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");
2011-05-15, 3446👍, 0💬

How to create a popup warning box?
How to create a popup warning box? alert('Warning: Please enter an integer between 0 and 100.');
2011-03-01, 3430👍, 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
2011-01-25, 3429👍, 0💬

How to force a page to go to another page using JavaScript?
How to force a page to go to another page using JavaScript? &lt;script language="JavaScript" type="text/javascript" >&lt;!-- location.href="http://newhost/ newpath/newfile.html";//-->&lt;/script>
2011-06-14, 3332👍, 0💬

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