Your Open Source
Free YourOpenSource Softwares Online Resources and Softwares Downloads with Demo
JavaScript
Disabled the Right Click menu in JS
Disabled the Right Click menu on the document You can disabled menu when right click of the document, the javascript code as follows, var isNS = (navigator.appName == "Netscape") ? 1 : 0; if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP); function chkMenu(){ return false; } function mous..
178
Mar 06 09 07:50:38
Sekar
Cookies handling in Javascript
Cookies handling in Javascript : The following js scripts to GET / SET the datas into cookies and also you can get the all cookies from this scripts.
2864
Jun 15 08 04:36:03
Sekar
How to find position of the element in JS
How to find position of the element in JS ? : You can easy to find the possion of the elements or any objects in the document.
3143
Jun 15 08 04:35:54
Sekar
How to get the form values in JS
How to get the form values in JS:- You can get the form values in the document by using getElementById() or getElementByName() function. Both functions get the element from the document.
216
Jul 07 08 10:26:35
Sekar
GetElementById or getElementByName Method
getElementById or getElementBy Name : You can get the element values from the document by using getElementById() or getElementByName() function. Both functions get the element from the document.Syntax: getElementById("element_id"); getEl..
3778
Oct 09 09 11:35:11
Sekar
Javascript or PHP Rating Script Download
Javascript or PHP Rating Script Download :- Here you can view or download the PHP / Javascript Rating script.
299
Jul 16 08 02:29:56
Sekar
ADD New DIV or Button within the HTML Document through Javascript
How to add new row within div in javascript:- The createElement() and appendChild() function used to you can create a new div or input tags in the HTML document. The example code given below, ADD New DIV or Button within the HTML Document through Javascript row=1; function addRow(){ row = row + 1; var nd = document.createEleme..
219
Jul 31 08 01:00:44
Sekar
How to change first letter inside the texbox using javascript
How to change first letter inside the texbox using javascript :- ucfirst() function used to change the first letter of the string. The Javascript function and HTML form given below, function ucfirst( str ) { var firstChar = str.charAt(0).toUpperCase(); return firstChar + str.substr(1, str.length-1); }
193
Jul 31 08 02:19:39
Nima
How To Show and Hide the DIV
Show and Hide the DIV in JavascirptShow and Hide the div tag by using Javascript(JS). The example code as follows settilldate(divname,1l) function settilldate(divname,no_val){ document.getElementById(divname).checked; if(no_val==return_value){ if(document.getElementById(divname).style.display == 'block'){ document.getElementById(divna..
173
Aug 07 08 04:02:45
Damu
How to deselect or select the SELSECT box value using javascript
how to deselect or select the SELSECT box value using javascript document.getElementById("selectid").selectedIndex = 0;// to select the 0'th index document.getElementById("selectid").selectedIndex = 4;
8997
Aug 13 08 11:42:44
Damu
IsNumeric and IsNan function in JS
IsNumeric function used to check the numeric or not. isNaN function used to check the value is a number or not. If the values is numeric its return true else returned false. Syntax : bool IsNumeric(string) Code : function IsNumeric(val) { if (isNaN(parseFloat(val))) { return false; } return true }
43148
Aug 28 08 03:26:52
Sekar
Print the web Page
The JS print() function used to print the current web page. The code as follows,
170
Oct 16 08 03:21:26
Sekar
Elements and attributes properties in JS
Elements properties used to get the all element of the form and attributes properties used to get the all attributes of the particular element on the document. The example code given below, var elements = document.egform.elements; for(var i = 0; i < elements.length; i++) { var list = form[i].attributes ; try{ var node = list['n..
113
Mar 03 09 01:23:04
Sekar
Get the all attributes of the element in JS
Get the all attributes of the element in JS //html code //js code //get all attributes of the object var list = document.getElementById('name').attributes ; var node = list['verify'].nodeValue;
247
Jan 29 09 10:02:57
Sekar
Get childNodes from the parentnode or element
childNodes used to get the all the childs from the elements or parent node, the example code given below, //return as array of the childs on the 'obj_frm' element. var child = document.getElementById('obj_frm').childNodes;
125
Mar 03 09 01:31:42
Sekar
How to get the domain name using javascript
Hi i need to get the host name using the java script host=window.location.hostname; if (host=="localhost") { alert("local host"); } else { alert("no local host"); }
155
Mar 13 09 05:25:36
Damu
How to enable or desable the text box usng javascript
JAVASCRIPT PART if(window.document.getElementById('checkBox1').checked == true) { document.emailfrm.mailid.disabled=false; // document.emailfrm.mailid.disabled=true; } HTML PART Enable
127
Apr 08 09 06:13:46
Damu
Strip_tags in JS
Right Now, strip_tags in js, its strip the all HTML tags as like PHP strip_tags, function strip_tags(input){ return input.replace(/]+>/gi, ''); }
440
Apr 10 09 12:31:35
Sekar
SetAttribute in js
The setAttribute() function used to change the element attributes at runtime. The Syntax, element.setAttribute(attr_name,attr_value); Example document.getElementById("user").setAttribute("type","password"); Note: In IE browser is not supported for the changing the TYPE of input tag, otherwise it will be working fine in IE and other all b..
164
Apr 16 09 07:27:56
Sekar
Assign a javascript value to html dropdown
Untitled Document WASHINGTON WEST VIRGINIA WISCONSIN WYOMING var obj = document.getElementById("state"); obj.value ='WV';
120
May 19 09 08:15:47
Karthick
How to get the time stamp value using the javascript
get the Current date value time stamp value var d = new Date(); var today = new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime(); // today obv
134
May 21 09 11:49:02
Damu
Get the GMT value using the javascript
var d = new Date(cal.year, cal.month, 1); alert("da"+d);
139
May 21 09 11:51:18
Damu
Replace function in JS
The Javascript replace() function is used to replace some characters in given the input string. Syntax is :- strObj.replace(find,replace); The following parameter used to can be replace the string, - i => Case-insensitive Search - g => Global Search - gi => both Example, var str="YOS - Replace in JS"; document.write(str.replace(/yos/i..
93
Jul 08 09 10:11:06
Sekar
Array count values in JS
The array_count_values() function used to get the array count values of the particular element,also get the how many times occur on the values in the array, the Java script code given below, function array_count_values(a) { var b = Array(), i = a.length, j; while( i-- ) { j = b[a[i]]; b[a[i]] = j ? j+1 : 1; } return b; } var val=[1,1..
77
Jul 08 09 10:42:30
Sekar
Foreach in JS
foreach loop in Javascript Actually It's javascript "FOR" loop, but its works similar like PHP foreach looping statment so its equivalent to foreach loop statement, the javascript given below, var author = Array("Sam","Craig","Nick"); var output=''; for( i in author ){ output += i + " . " + author[i] + "" ; } document.write(output); ..
298
Jul 08 09 03:01:25
Sekar
How to get the name of the day from the given date in Javascript
how to get the dayname of the todays date using the javascript function dayOfDate(){ var todaydate = new Date(); var day_name =new Array(7); day_name[0]="Sunday"; day_name[1]="Monday"; day_name[2]="Tuesday"; day_name[3]="Wednesday"; day_name[4]="Thursday"; day_name[5]="Friday"; day_name[6]="Saturday"; alert(day_name[todaydate.getDay()]..
83
Jul 10 09 12:14:51
Damu
Append or insert element in JS JQuery Moo tools
How to append or insert element by using mootools or jquery or javascript, you script as follows, In Javascript, var msg_row = document.createElement('Test'); document.getElementById('log_res').appendChild(msg_row); In Jquery $("#log_res").append("Test"); In Mootools var obj = new Element('div', { 'id': 'id_name', 'text': 'Test msg'..
236
Jul 22 09 06:11:17
Sekar
Javascript onclick
OnClick in JS The following way to use the javascript functions or code in the A tags or other tags For example A tag, 1. javascript:alert("clicked!"); Click Here 2. javascript Onclick method Click Here the above both ways will works in all browsers.
61
Aug 15 09 09:12:17
Sekar




