Your Open Source

JavaScript

Browse

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..

  • views 178
  • datetime Mar 06 09 07:50:38
  • author Sekar
  • rating

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.

  • views 2864
  • datetime Jun 15 08 04:36:03
  • author Sekar
  • rating

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.

  • views 3143
  • datetime Jun 15 08 04:35:54
  • author Sekar
  • rating

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.

  • views 216
  • datetime Jul 07 08 10:26:35
  • author Sekar
  • rating

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..

  • views 3778
  • datetime Oct 09 09 11:35:11
  • author Sekar
  • rating

Javascript or PHP Rating Script Download

Javascript or PHP Rating Script Download :-       Here you can view or download the PHP / Javascript Rating script.

  • views 299
  • datetime Jul 16 08 02:29:56
  • author Sekar
  • rating

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..

  • views 219
  • datetime Jul 31 08 01:00:44
  • author Sekar
  • rating

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); }

  • views 193
  • datetime Jul 31 08 02:19:39
  • author Nima
  • rating

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..

  • views 173
  • datetime Aug 07 08 04:02:45
  • author Damu
  • rating

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;

  • views 8997
  • datetime Aug 13 08 11:42:44
  • author Damu
  • rating

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 }

  • views 43148
  • datetime Aug 28 08 03:26:52
  • author Sekar
  • rating

Print the web Page

The JS print() function used to print the current web page. The code as follows,

  • views 170
  • datetime Oct 16 08 03:21:26
  • author Sekar
  • rating

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..

  • views 113
  • datetime Mar 03 09 01:23:04
  • author Sekar
  • rating

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;

  • views 247
  • datetime Jan 29 09 10:02:57
  • author Sekar
  • rating

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;

  • views 125
  • datetime Mar 03 09 01:31:42
  • author Sekar
  • rating

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"); }

  • views 155
  • datetime Mar 13 09 05:25:36
  • author Damu
  • rating

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

  • views 127
  • datetime Apr 08 09 06:13:46
  • author Damu
  • rating

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, ''); }

  • views 440
  • datetime Apr 10 09 12:31:35
  • author Sekar
  • rating

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..

  • views 164
  • datetime Apr 16 09 07:27:56
  • author Sekar
  • rating

Assign a javascript value to html dropdown

Untitled Document WASHINGTON WEST VIRGINIA WISCONSIN WYOMING var obj = document.getElementById("state"); obj.value ='WV';

  • views 120
  • datetime May 19 09 08:15:47
  • author Karthick
  • rating

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

  • views 134
  • datetime May 21 09 11:49:02
  • author Damu
  • rating

Get the GMT value using the javascript

var d = new Date(cal.year, cal.month, 1); alert("da"+d);

  • views 139
  • datetime May 21 09 11:51:18
  • author Damu
  • rating

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..

  • views 93
  • datetime Jul 08 09 10:11:06
  • author Sekar
  • rating

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..

  • views 77
  • datetime Jul 08 09 10:42:30
  • author Sekar
  • rating

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); ..

  • views 298
  • datetime Jul 08 09 03:01:25
  • author Sekar
  • rating

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()]..

  • views 83
  • datetime Jul 10 09 12:14:51
  • author Damu
  • rating

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'..

  • views 236
  • datetime Jul 22 09 06:11:17
  • author Sekar
  • rating

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.

  • views 61
  • datetime Aug 15 09 09:12:17
  • author Sekar
  • rating

Featured
Top User's
sekarSekar
Posts 172
$103.18 USD
tjrambabuTjrambabu
Posts 145
$17.96 USD
damuDamu
Posts 67
$16.75 USD
lazywriterLazywriter
Posts 24
$3.11 USD
psbharathyPsbharathy
Posts 24
$4.19 USD