<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IdealProgrammer.com</title>
	<atom:link href="http://idealprogrammer.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://idealprogrammer.com</link>
	<description>Take a Little Action each Day to Transform Yourself into the Ideal Programmer</description>
	<lastBuildDate>Sat, 06 Mar 2010 14:33:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 16:48:05 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[ondblclick JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=2012</guid>
		<description><![CDATA[ondblclick JavaScript (JS) Example: HTML DOM Objects - Event - ondblclick JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/html-dom-event-object-examples-javascript-js/' rel='bookmark' title='Permanent Link: HTML DOM Event Object Examples JavaScript (JS)'>HTML DOM Event Object Examples JavaScript (JS)</a> <small>HTML DOM Event Object Examples JavaScript (JS)...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/ondblclick+event" target="_blank">ondblclick Event</a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Event-object-examples/">View Other Attributes and Handlers for DOM Events</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> Object.ondblclick=&#034;yourjavascriptcode()&#034;  </em> &#8211; Allows you to know when double click event occurs.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be <strong>JavaScript_Syntax</strong>.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMEventEventHandlers.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named <strong>&#034;HTMLDOMObjects&#034;</strong>
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named <strong>&#034;DOMEvent&#034;</strong>
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMEvent</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMEvent&#034; subfolder named <strong>&#034;EventHandlers&#034;</strong>
<ul>
<li>Right-click subfolder named &#034;DOMEvent&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: EventHandlers</li>
</ul>
</li>
<li>Add HTML Page Named <strong>ondblclick</strong> to EventHandlers subfolder
<ul>
<li>Right-click EventHandlers subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be ondblclick</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page ondblclick.htm</li>
<li>Right-click on HTML page ondblclick.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMEvent/EventHandlers/ondblclick.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: ondblclick <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">***************************************************</span></li><li><span style="color: #808080; font-style: italic;">* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">***************************************************</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;"> DOM Objects</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">***&nbsp;&nbsp;&nbsp;&nbsp;DOM Event - EventHandlers&nbsp;&nbsp; ***</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">*** ondblclick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">SYNTAX:</span></li><li><span style="color: #808080; font-style: italic;">object.ondblclick=&quot;yourjavascriptcode()&quot;&nbsp;&nbsp;Allows you to know when double-click</span></li><li><span style="color: #808080; font-style: italic;">event occurs</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">=================================================================</span></li><li><span style="color: #808080; font-style: italic;">An EXCELLENT tutorial on event basics can be found at:</span></li><li><span style="color: #808080; font-style: italic;">http://www.quirksmode.org/js/introevents.html</span></li><li><span style="color: #808080; font-style: italic;">=================================================================</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">You can access the following properties thru the event handler:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Available Properties</span></li><li><span style="color: #808080; font-style: italic;">altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.</span></li><li><span style="color: #808080; font-style: italic;">altLeft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a value that indicates the state of the left ALT key.</span></li><li><span style="color: #808080; font-style: italic;">clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">ctrlLeft	 Sets or retrieves the state of the left CTRL key.</span></li><li><span style="color: #808080; font-style: italic;">offsetX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">offsetY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">returnValue	 Sets or retrieves the return value from the event.</span></li><li><span style="color: #808080; font-style: italic;">screenX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">screenY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">shiftLeft	 Retrieves the state of the left SHIFT key.</span></li><li><span style="color: #808080; font-style: italic;">srcElement	 Sets or retrieves the object that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">type	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the event name from the event object.</span></li><li><span style="color: #808080; font-style: italic;">x	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">y	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">The captureEvents() method captures all the events of the event type passed.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">When you have multiple events to capture, separate them with the pipe, |, character.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Here are the types of event you can capture:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Event.ABORT</span></li><li><span style="color: #808080; font-style: italic;">Event.BLUR</span></li><li><span style="color: #808080; font-style: italic;">Event.CHANGE</span></li><li><span style="color: #808080; font-style: italic;">Event.CLICK</span></li><li><span style="color: #808080; font-style: italic;">Event.DBLCLICK</span></li><li><span style="color: #808080; font-style: italic;">Event.DRAGDROP</span></li><li><span style="color: #808080; font-style: italic;">Event.ERROR</span></li><li><span style="color: #808080; font-style: italic;">Event.FOCUS</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYDOWN</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYPRESS</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYUP</span></li><li><span style="color: #808080; font-style: italic;">Event.LOAD</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEDOWN</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEMOVE</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEOUT</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEOVER</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEUP</span></li><li><span style="color: #808080; font-style: italic;">Event.MOVE</span></li><li><span style="color: #808080; font-style: italic;">Event.RESET</span></li><li><span style="color: #808080; font-style: italic;">Event.RESIZE</span></li><li><span style="color: #808080; font-style: italic;">Event.SELECT</span></li><li><span style="color: #808080; font-style: italic;">Event.SUBMIT</span></li><li><span style="color: #808080; font-style: italic;">Event.UNLOAD</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">--&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// Arrays of possible properties</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theTargets <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'target'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'relatedTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'currentTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'originalTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'srcElement'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'fromElement'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'toElement'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theMouse <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'clientX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'clientY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'x'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'y'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'layerX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'layerY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'screenX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'screenY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'offsetX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'offsetY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'pageX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'pageY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'which'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'button'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'detail'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'wheelDelta'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theKeys <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'modifiers'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'which'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'keyCode'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'charCode'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'isChar'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'shiftKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'shiftLeft'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'metaKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'altKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'altLeft'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'ctrlKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'ctrlLeft'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theType <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'type'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'eventPhase'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'bubbles'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'cancelable'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'cancelBubble'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'detail'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'returnValue'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'timeStamp'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'view'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> writeAvailableProperties<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">altkey</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">clientX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;div style='background-color:Yellow;border-color:black;border-style:solid;border-width:1px;'&gt; Please use browser back button to return to previous page&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">function</span> doSomething<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e<span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> window.<span style="color: #660066;">event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// e refers to the event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> string <span style="color: #339933;">=</span> printInfo<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// Print out property information based on user checking of form</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> printInfo<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> printstring <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span> printstring <span style="color: #339933;">+=</span>	<span style="color: #3366CC;">'Event is now in layer '</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> possibilities <span style="color: #339933;">=</span> document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>possibilities .<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></li><li>	<span style="color: #009900;">&#123;</span></li><li>		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span></li><li>		<span style="color: #009900;">&#123;</span></li><li>			<span style="color: #003366; font-weight: bold;">var</span> thearray <span style="color: #339933;">=</span> self<span style="color: #009900;">&#91;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span>thearray.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></li><li>			<span style="color: #009900;">&#123;</span></li><li>				<span style="color: #003366; font-weight: bold;">var</span> current <span style="color: #339933;">=</span> e<span style="color: #009900;">&#91;</span>thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>				<span style="color: #003366; font-weight: bold;">var</span> curr <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">typeof</span> current<span style="color: #339933;">;</span></li><li><span style="color: #006600; font-style: italic;">//				alert(thearray[j] + ' is ' + curr);</span></li><li>				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>curr <span style="color: #339933;">==</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>curr <span style="color: #339933;">==</span> <span style="color: #3366CC;">'object'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>current<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span></li><li>				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'theTargets'</span><span style="color: #009900;">&#41;</span></li><li>				<span style="color: #009900;">&#123;</span></li><li>					<span style="color: #003366; font-weight: bold;">var</span> tag <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">tagName</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> current.<span style="color: #660066;">tagName</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'[unknown tag]'</span><span style="color: #339933;">;</span></li><li>					<span style="color: #003366; font-weight: bold;">var</span> tagid <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> current.<span style="color: #660066;">id</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'[no id]'</span><span style="color: #339933;">;</span></li><li>					printstring <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' = '</span> <span style="color: #339933;">+</span> tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">' '</span> <span style="color: #339933;">+</span> tagid<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>				<span style="color: #009900;">&#125;</span></li><li>				<span style="color: #000066; font-weight: bold;">else</span></li><li>					printstring <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' = '</span> <span style="color: #339933;">+</span> current<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>			<span style="color: #009900;">&#125;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>printstring<span style="color: #009900;">&#41;</span> printstring <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Alert required for example<span style="color: #000099; font-weight: bold;">\n</span>Use checkboxes to see useful information'</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">return</span> printstring<span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>possibilities&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Example #1: Check the categories and double click button to see ondblclick Attributes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span>&gt;</span>Show</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theType&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> type/misc</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theTargets&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> targets</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theMouse&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> mouse stuff</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theKeys&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> key stuff</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;double click me&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// This is the &quot;traditional&quot; and recommended technique for registering an event</span></li><li><span style="color: #006600; font-style: italic;">// handler because it allows you to separate structure from behavior; the</span></li><li><span style="color: #006600; font-style: italic;">// &quot;inline&quot; method of registering an event within xhtml tags is not</span></li><li><span style="color: #006600; font-style: italic;">// the recommended approach because it blurs structure and behavior.</span></li><li><span style="color: #006600; font-style: italic;">// For complete explanation, please see the following excellent article:</span></li><li><span style="color: #006600; font-style: italic;">// http://www.digital-web.com/articles/separating_behavior_and_structure_2/</span></li><li><span style="color: #006600; font-style: italic;">//</span></li><li><span style="color: #006600; font-style: italic;">// Note: Using getElementById so registering event will work in FireFox</span></li><li><span style="color: #006600; font-style: italic;">//</span></li><li><span style="color: #003366; font-weight: bold;">var</span> mybutton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button1&quot;</span><span style="color: #009900;">&#41;</span></li><li>mybutton.<span style="color: #660066;">ondblclick</span> <span style="color: #339933;">=</span> doSomething<span style="color: #339933;">;</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mybutton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#41;</span> mybutton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">CLICK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>&nbsp;&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">hr</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Example #2: Double click button Below to See ondblclick Copy Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span></li><li>&nbsp;</li><li>FieldA: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fieldA&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Copy Me!&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>FieldB: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fieldB&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>Click the button below to copy the content of FieldA to FieldB.</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">ondblclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;document.getElementById('fieldB').value=</span></span></li><li><span style="color: #009900;"><span style="color: #ff0000;">document.getElementById('fieldA').value&quot;</span>&gt;</span>Double Click to Copy<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/html-dom-event-object-examples-javascript-js/' rel='bookmark' title='Permanent Link: HTML DOM Event Object Examples JavaScript (JS)'>HTML DOM Event Object Examples JavaScript (JS)</a> <small>HTML DOM Event Object Examples JavaScript (JS)...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 13:40:05 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onClick JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=2001</guid>
		<description><![CDATA[onClick JavaScript (JS) Example: HTML DOM Objects - Event - onClick JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/onClick+event" target="_blank">onClick Event</a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Event-object-examples/">View Other Attributes and Handlers for DOM Events</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> Object.onClick=&#034;yourjavascriptcode()&#034;  </em> &#8211; Allows you to know when text or selection for element has changed.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be <strong>JavaScript_Syntax</strong>.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMEventEventHandlers.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named <strong>&#034;HTMLDOMObjects&#034;</strong>
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named <strong>&#034;DOMEvent&#034;</strong>
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMEvent</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMEvent&#034; subfolder named <strong>&#034;EventHandlers&#034;</strong>
<ul>
<li>Right-click subfolder named &#034;DOMEvent&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: EventHandlers</li>
</ul>
</li>
<li>Add HTML Page Named <strong>onClick</strong> to EventHandlers subfolder
<ul>
<li>Right-click EventHandlers subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be onClick</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page onClick.htm</li>
<li>Right-click on HTML page onClick.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMEvent/EventHandlers/onClick.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: onClick <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">***************************************************</span></li><li><span style="color: #808080; font-style: italic;">* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">***************************************************</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;"> DOM Objects</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">***&nbsp;&nbsp;&nbsp;&nbsp;DOM Event - EventHandlers&nbsp;&nbsp; ***</span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">*** onClick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></li><li><span style="color: #808080; font-style: italic;">*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">SYNTAX:</span></li><li><span style="color: #808080; font-style: italic;">object.onClick=&quot;yourjavascriptcode()&quot;&nbsp;&nbsp;Allows you to know when click</span></li><li><span style="color: #808080; font-style: italic;">event occurs</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">=================================================================</span></li><li><span style="color: #808080; font-style: italic;">An EXCELLENT tutorial on event basics can be found at:</span></li><li><span style="color: #808080; font-style: italic;">http://www.quirksmode.org/js/introevents.html</span></li><li><span style="color: #808080; font-style: italic;">=================================================================</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">You can access the following properties thru the event handler:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Available Properties</span></li><li><span style="color: #808080; font-style: italic;">altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.</span></li><li><span style="color: #808080; font-style: italic;">altLeft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a value that indicates the state of the left ALT key.</span></li><li><span style="color: #808080; font-style: italic;">clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">ctrlLeft	 Sets or retrieves the state of the left CTRL key.</span></li><li><span style="color: #808080; font-style: italic;">offsetX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">offsetY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">returnValue	 Sets or retrieves the return value from the event.</span></li><li><span style="color: #808080; font-style: italic;">screenX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">screenY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">shiftLeft	 Retrieves the state of the left SHIFT key.</span></li><li><span style="color: #808080; font-style: italic;">srcElement	 Sets or retrieves the object that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">type	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the event name from the event object.</span></li><li><span style="color: #808080; font-style: italic;">x	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">y	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">The captureEvents() method captures all the events of the event type passed.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">When you have multiple events to capture, separate them with the pipe, |, character.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Here are the types of event you can capture:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">Event.ABORT</span></li><li><span style="color: #808080; font-style: italic;">Event.BLUR</span></li><li><span style="color: #808080; font-style: italic;">Event.CHANGE</span></li><li><span style="color: #808080; font-style: italic;">Event.CLICK</span></li><li><span style="color: #808080; font-style: italic;">Event.DBLCLICK</span></li><li><span style="color: #808080; font-style: italic;">Event.DRAGDROP</span></li><li><span style="color: #808080; font-style: italic;">Event.ERROR</span></li><li><span style="color: #808080; font-style: italic;">Event.FOCUS</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYDOWN</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYPRESS</span></li><li><span style="color: #808080; font-style: italic;">Event.KEYUP</span></li><li><span style="color: #808080; font-style: italic;">Event.LOAD</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEDOWN</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEMOVE</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEOUT</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEOVER</span></li><li><span style="color: #808080; font-style: italic;">Event.MOUSEUP</span></li><li><span style="color: #808080; font-style: italic;">Event.MOVE</span></li><li><span style="color: #808080; font-style: italic;">Event.RESET</span></li><li><span style="color: #808080; font-style: italic;">Event.RESIZE</span></li><li><span style="color: #808080; font-style: italic;">Event.SELECT</span></li><li><span style="color: #808080; font-style: italic;">Event.SUBMIT</span></li><li><span style="color: #808080; font-style: italic;">Event.UNLOAD</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">--&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// Arrays of possible properties</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theTargets <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'target'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'relatedTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'currentTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'originalTarget'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'srcElement'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'fromElement'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'toElement'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theMouse <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'clientX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'clientY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'x'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'y'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'layerX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'layerY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'screenX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'screenY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'offsetX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'offsetY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'pageX'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'pageY'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'which'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'button'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'detail'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'wheelDelta'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theKeys <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'modifiers'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'which'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'keyCode'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'charCode'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'isChar'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'shiftKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'shiftLeft'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'metaKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'altKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'altLeft'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'ctrlKey'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'ctrlLeft'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">var</span> theType <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span></li><li>	<span style="color: #3366CC;">'type'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'eventPhase'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'bubbles'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'cancelable'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'cancelBubble'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'detail'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'returnValue'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'timeStamp'</span><span style="color: #339933;">,</span></li><li>	<span style="color: #3366CC;">'view'</span></li><li><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> writeAvailableProperties<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">altkey</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">clientX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;div style='background-color:Yellow;border-color:black;border-style:solid;border-width:1px;'&gt; Please use browser back button to return to previous page&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">function</span> doSomething<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e<span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> window.<span style="color: #660066;">event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// e refers to the event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> string <span style="color: #339933;">=</span> printInfo<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// Print out property information based on user checking of form</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> printInfo<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> printstring <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span> printstring <span style="color: #339933;">+=</span>	<span style="color: #3366CC;">'Event is now in layer '</span> <span style="color: #339933;">+</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> possibilities <span style="color: #339933;">=</span> document.<span style="color: #660066;">forms</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">elements</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>possibilities .<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></li><li>	<span style="color: #009900;">&#123;</span></li><li>		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">checked</span><span style="color: #009900;">&#41;</span></li><li>		<span style="color: #009900;">&#123;</span></li><li>			<span style="color: #003366; font-weight: bold;">var</span> thearray <span style="color: #339933;">=</span> self<span style="color: #009900;">&#91;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span>thearray.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span></li><li>			<span style="color: #009900;">&#123;</span></li><li>				<span style="color: #003366; font-weight: bold;">var</span> current <span style="color: #339933;">=</span> e<span style="color: #009900;">&#91;</span>thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>				<span style="color: #003366; font-weight: bold;">var</span> curr <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">typeof</span> current<span style="color: #339933;">;</span></li><li><span style="color: #006600; font-style: italic;">//				alert(thearray[j] + ' is ' + curr);</span></li><li>				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>curr <span style="color: #339933;">==</span> <span style="color: #3366CC;">'undefined'</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span>curr <span style="color: #339933;">==</span> <span style="color: #3366CC;">'object'</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span>current<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">continue</span><span style="color: #339933;">;</span></li><li>				<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>possibilities<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">==</span> <span style="color: #3366CC;">'theTargets'</span><span style="color: #009900;">&#41;</span></li><li>				<span style="color: #009900;">&#123;</span></li><li>					<span style="color: #003366; font-weight: bold;">var</span> tag <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">tagName</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> current.<span style="color: #660066;">tagName</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'[unknown tag]'</span><span style="color: #339933;">;</span></li><li>					<span style="color: #003366; font-weight: bold;">var</span> tagid <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>current.<span style="color: #660066;">id</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> current.<span style="color: #660066;">id</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'[no id]'</span><span style="color: #339933;">;</span></li><li>					printstring <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' = '</span> <span style="color: #339933;">+</span> tag <span style="color: #339933;">+</span> <span style="color: #3366CC;">' '</span> <span style="color: #339933;">+</span> tagid<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>				<span style="color: #009900;">&#125;</span></li><li>				<span style="color: #000066; font-weight: bold;">else</span></li><li>					printstring <span style="color: #339933;">+=</span> <span style="color: #3366CC;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span> <span style="color: #339933;">+</span> thearray<span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">' = '</span> <span style="color: #339933;">+</span> current<span style="color: #339933;">;</span></li><li>&nbsp;</li><li>			<span style="color: #009900;">&#125;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>printstring<span style="color: #009900;">&#41;</span> printstring <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Alert required for example<span style="color: #000099; font-weight: bold;">\n</span>Use checkboxes to see useful information'</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">return</span> printstring<span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> doConfirm<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066;">confirm</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Do you really want to follow this link?'</span><span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span>possibilities&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Example #1: Check the categories and click button to see onClick Attributes<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">form</span>&gt;</span>Show</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theType&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> type/misc</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theTargets&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> targets</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theMouse&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> mouse stuff</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;checkbox&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;theKeys&quot;</span><span style="color: #66cc66;">/</span>&gt;</span> key stuff</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">form</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">// This is the &quot;traditional&quot; and recommended technique for registering an event</span></li><li><span style="color: #006600; font-style: italic;">// handler because it allows you to separate structure from behavior; the</span></li><li><span style="color: #006600; font-style: italic;">// &quot;inline&quot; method of registering an event within xhtml tags is not</span></li><li><span style="color: #006600; font-style: italic;">// the recommended approach because it blurs structure and behavior.</span></li><li><span style="color: #006600; font-style: italic;">// For complete explanation, please see the following excellent article:</span></li><li><span style="color: #006600; font-style: italic;">// http://www.digital-web.com/articles/separating_behavior_and_structure_2/</span></li><li><span style="color: #006600; font-style: italic;">//</span></li><li><span style="color: #006600; font-style: italic;">// Note: Using getElementById so registering event will work in FireFox</span></li><li><span style="color: #006600; font-style: italic;">//</span></li><li><span style="color: #003366; font-weight: bold;">var</span> mybutton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button1&quot;</span><span style="color: #009900;">&#41;</span></li><li>mybutton.<span style="color: #660066;">onclick</span> <span style="color: #339933;">=</span> doSomething<span style="color: #339933;">;</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mybutton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#41;</span> mybutton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">CLICK</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>&nbsp;&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">hr</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Example #2: Click Link Below to See onClick Prevent Default Behavior<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://idealprogrammer.com&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;return doConfirm()&quot;</span>&gt;</span>Ideal Programmer<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>When onclick is passed a false return value, the default behavior (going to the </li><li>new page) is prevented.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">hr</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h2</span>&gt;</span>Example #3: Click Link Below to See onClick Copy Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h2</span>&gt;</span></li><li>&nbsp;</li><li>FieldA: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fieldA&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Copy Me!&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>FieldB: <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;fieldB&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>Click the button below to copy the content of FieldA to FieldB.</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">button</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;document.getElementById('fieldB').value=</span></span></li><li><span style="color: #009900;"><span style="color: #ff0000;">document.getElementById('fieldA').value&quot;</span>&gt;</span>Copy<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">button</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 00:50:31 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onChange JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1994</guid>
		<description><![CDATA[onChange JavaScript (JS) Example: HTML DOM Objects - Event - onChange JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/' rel='bookmark' title='Permanent Link: onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example'>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</a> <small>onClick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/onChange+event" target="_blank">onChange Event</a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Event-object-examples/">View Other Attributes and Handlers for DOM Events</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> Object.onChange=&#034;yourjavascriptcode()&#034;  </em> &#8211; Allows you to know when text or selection for element has changed.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be <strong>JavaScript_Syntax</strong>.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMEventEventHandlers.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named <strong>&#034;HTMLDOMObjects&#034;</strong>
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named <strong>&#034;DOMEvent&#034;</strong>
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMEvent</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMEvent&#034; subfolder named <strong>&#034;EventHandlers&#034;</strong>
<ul>
<li>Right-click subfolder named &#034;DOMEvent&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: EventHandlers</li>
</ul>
</li>
<li>Add HTML Page Named <strong>onChange</strong> to EventHandlers subfolder
<ul>
<li>Right-click EventHandlers subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be onChange</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page onChange.htm</li>
<li>Right-click on HTML page onChange.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMEvent/EventHandlers/onChange.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: onChange <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // DOM Objects</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;DOM Event - EventHandlers&nbsp;&nbsp; ***</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // onChange</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;object.onChange=&quot;yourjavascriptcode()&quot;&nbsp;&nbsp;Allows you to know when object</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;text has been changed</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =================================================================</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An EXCELLENT tutorial on event basics can be found at:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.quirksmode.org/js/introevents.html</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =================================================================</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You can access the following properties thru the event handler:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Available Properties</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;altLeft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a value that indicates the state of the left ALT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctrlLeft	 Sets or retrieves the state of the left CTRL key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsetX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsetY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;returnValue	 Sets or retrieves the return value from the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;screenX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;screenY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shiftLeft	 Retrieves the state of the left SHIFT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srcElement	 Sets or retrieves the object that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the event name from the event object.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The captureEvents() method captures all the events of the event type passed.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;When you have multiple events to capture, separate them with the pipe, |, character.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Here are the types of event you can capture:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.ABORT</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.BLUR</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.CHANGE</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.CLICK</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.DBLCLICK</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.DRAGDROP</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.ERROR</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.FOCUS</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.KEYDOWN</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.KEYPRESS</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.KEYUP</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.LOAD</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOUSEDOWN</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOUSEMOVE</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOUSEOUT</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOUSEOVER</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOUSEUP</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.MOVE</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.RESET</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.RESIZE</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.SELECT</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.SUBMIT</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event.UNLOAD</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> writeAvailableProperties<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">altkey</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">clientX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;div style='background-color:Yellow;border-color:black;border-style:solid;border-width:1px;'&gt; Please use browser back button to return to previous page&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> doSomething<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e<span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> window.<span style="color: #660066;">event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// e refers to the event</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">clientY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;br /&gt;&lt;div style='background-color:Yellow;border-color:black;border-style:solid;border-width:1px;'&gt; Please use browser back button to return to previous page&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">h1</span>&gt;</span>Change Text Fields and Select from DropDown to see onChange in Action<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">h1</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtState&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;State&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">onchange</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;alert(event.srcElement.name + '\n' + event.srcElement.type)&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtCountry&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Country&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">onchange</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;writeAvailableProperties()&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;idZip&quot;</span></span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtZip&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Zip&quot;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idZip.<span style="color: #660066;">onchange</span> <span style="color: #339933;">=</span> doSomething<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>idZip.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#41;</span> idZip.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">CHANGE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Select a different option in the drop-down list box to trigger the onchange event.<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">select</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Groceries&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;idGroceries&quot;</span> &gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Fruit&quot;</span>&gt;</span>Fruit<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Meat&quot;</span>&gt;</span>Meat<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">option</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Vegatables&quot;</span>&gt;</span>Vegatables<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">option</span>&gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">select</span>&gt;</span> <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></li><li>	<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// This is the &quot;traditional&quot; and recommended technique for registering an event</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// handler because it allows you to separate structure from behavior; the</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// &quot;inline&quot; method of registering an event within xhtml tags is not</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// the recommended approach because it blurs structure and behavior.</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// For complete explanation, please see the following excellent article:</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// http://www.digital-web.com/articles/separating_behavior_and_structure_2/</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// Note: Using getElementById so registering event will work in FireFox</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> mySelect <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;idGroceries&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;mySelect.<span style="color: #660066;">onchange</span> <span style="color: #339933;">=</span> doSomething<span style="color: #339933;">;</span></li><li>	&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>mySelect.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#41;</span> mySelect.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #660066;">CHANGE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>&nbsp;&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/' rel='bookmark' title='Permanent Link: onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example'>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</a> <small>onClick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</title>
		<link>http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 23:17:27 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onBlur JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1987</guid>
		<description><![CDATA[onBlur JavaScript (JS) Example HTML DOM Objects Event<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/' rel='bookmark' title='Permanent Link: onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example'>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</a> <small>onClick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/onBlur+event" target="_blank">onBlur Event</a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Event-object-examples/">View Other Attributes and Handlers for DOM Events</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> Object.onBlur=&#034;yourjavascriptcode()&#034;  </em> &#8211; Allows you to know when element has lost focus.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMEventEventHandlers.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMEvent&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMEvent</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMEvent&#034; subfolder named &#034;EventHandlers&#034;
<ul>
<li>Right-click subfolder named &#034;DOMEvent&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: EventHandlers</li>
</ul>
</li>
<li>Add HTML Page Named onBlur to EventHandlers subfolder
<ul>
<li>Right-click EventHandlers subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be onBlur</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page onBlur.htm</li>
<li>Right-click on HTML page onBlur.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMEvent/EventHandlers/onBlur.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: onBlur <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // DOM Objects</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;DOM Event - EventHandlers&nbsp;&nbsp; ***</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // onBlur</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;object.onBlur=&quot;yourjavascriptcode()&quot;&nbsp;&nbsp;Allows you to know when object</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;has lost focus</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =================================================================</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An EXCELLENT tutorial on event basics can be found at:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; http://www.quirksmode.org/js/introevents.html</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =================================================================</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; You can access the following properties thru the event handler:</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Available Properties</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;altLeft&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a value that indicates the state of the left ALT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctrlLeft	 Sets or retrieves the state of the left CTRL key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsetX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;offsetY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the object firing the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;screenX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;screenY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the user's screen.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shiftLeft	 Retrieves the state of the left SHIFT key.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;srcElement	 Sets or retrieves the object that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the event name from the event object.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate (in pixels) of the mouse pointer's offset from the closest relatively positioned parent element of the element that fired the event.</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> writeAvailableProperties<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">altkey</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - altKey	&nbsp;&nbsp;&nbsp;&nbsp; Retrieves a value that indicates the state of the ALT key.&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>event.<span style="color: #660066;">clientX</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientX	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the x-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;br /&gt;Use back button to return to page.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> doSomething<span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>e<span style="color: #009900;">&#41;</span> <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> window.<span style="color: #660066;">event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// e refers to the event</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">clientY</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; - clientY	&nbsp;&nbsp;&nbsp;&nbsp; Sets or retrieves the y-coordinate of the mouse pointer's position relative to the client area of the window, excluding window decorations and scroll bars.&lt;br /&gt;&lt;br /&gt;Use back button to return to page.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtState&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;State&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">onblur</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;alert(event.srcElement.name + '\n' + event.srcElement.type)&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtCountry&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Country&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">onblur</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;writeAvailableProperties()&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;txtZip&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Zip&quot;</span> </span></li><li><span style="color: #009900;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">onblur</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;alert(event.srcElement.name + '\n' + event.srcElement.type)&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// This is the &quot;traditional&quot; and recommended technique for registering an event</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// handler because it allows you to separate structure from behavior; the</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// &quot;inline&quot; method of registering an event within xhtml tags is not</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// the recommended approach because it blurs structure and behavior.</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// For complete explanation, please see the following excellent article:</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// http://www.digital-web.com/articles/separating_behavior_and_structure_2/</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// Note: Using getElementById so registering event will work in FireFox</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> myButton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button1&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myButton.<span style="color: #000066;">onblur</span> <span style="color: #339933;">=</span> doSomething<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>myButton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#41;</span> myButton.<span style="color: #660066;">captureEvents</span><span style="color: #009900;">&#40;</span>Event.<span style="color: #000066;">BLUR</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/' rel='bookmark' title='Permanent Link: onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example'>onClick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onClick JavaScript (JS) Example</a> <small>onClick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onAbort JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onAbort JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/onabort-javascript-js-html-dom-objects-event-onabort-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/onabort-javascript-js-html-dom-objects-event-onabort-javascript-js/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 13:53:22 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[onAbort JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1983</guid>
		<description><![CDATA[onAbort JavaScript (JS) Example: HTML DOM Objects - Event - onAbort JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>onAbort JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onAbort JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/Event+onAbort" target="_blank">Event onAbort  </a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Event-object-examples/">View Other Attributes and Handlers for DOM Events</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> ImageObject.onAbort=&#034;yourjavascriptcode()&#034;  </em> &#8211; Allows you to know when user has stopped the loading of an image by: 1. clicking link; 2. clicking browser stop button; 3. navigating to new page.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMEventEventHandlers.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMEvent&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMEvent</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMEvent&#034; subfolder named &#034;EventHandlers&#034;
<ul>
<li>Right-click subfolder named &#034;DOMEvent&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: EventHandlers</li>
</ul>
</li>
<li>Add HTML Page Named onAbort to EventHandlers subfolder
<ul>
<li>Right-click EventHandlers subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be onAbort</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page onAbort.htm</li>
<li>Right-click on HTML page onAbort.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMEvent/EventHandlers/onAbort.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: onAbort <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // DOM Objects</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;DOM Event - EventHandlers&nbsp;&nbsp; ***</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // onAbort</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //*****************************************************</span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;object.onAbort=&quot;yourjavascriptcode()&quot;&nbsp;&nbsp;Allows you to know when user has </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp;stopped the loading of an image by:</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; * Click an anchor.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; * Click the browser Stop button.</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp; * Navigate to another page. </span></li><li>&nbsp;</li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">function</span> abortImage<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Error: Loading of the image was aborted'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>			</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myBodyID&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-color:Yellow;border-color:black;border-style:solid;border-width:1px;&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To see abort message, do one of the following while image is loading:<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Click the browser stop button,<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. Click link on page, or <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3. Quickly navigate to new page<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If image is already loaded, use internet options to delete temporary internet </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; files and refresh page. That will remove image from cache so it will not load too fast next time.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://idealprogrammer.com&quot;</span>&gt;</span>IdealProgrammer - click while image is loading<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">img</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://graphics.stanford.edu/~mcammara/wtc-photo.jpg&quot;</span> onabort<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;abortImage()&quot;</span><span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/onabort-javascript-js-html-dom-objects-event-onabort-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML DOM Event Object Examples JavaScript (JS)</title>
		<link>http://idealprogrammer.com/uncategorized/html-dom-event-object-examples-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/html-dom-event-object-examples-javascript-js/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 01:43:10 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Event Object]]></category>
		<category><![CDATA[Examples]]></category>
		<category><![CDATA[HTML DOM]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JS]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1978</guid>
		<description><![CDATA[HTML DOM Event Object Examples JavaScript (JS)<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>Button Object Examples: HTML DOM Event Object Examples &#8211; Javascript JS</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for working with the  <a rel="tag" href="http://blogs.icerocket.com/tag/Event+Object" target="_blank">Event Object</a>. The Event object allows you to access properties related to events</p>
<p><center></p>
<h3>Event Object Examples</h3>
<table class="pretty" width="650" border="3" cellpadding="0" cellspacing="0">
<tbody>
<tr style="font-weight: bold;" align="center">
<td style="width: 100%; background-color: rgb(220, 220, 220); text-align: center;" colspan="2">Event Handlers</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com/code-samples/onabort-javascript-js-html-dom-objects-event-onabort-javascript-js/" target="_blank">onabort</a></td>
<td align="left" valign="top">Event happens when loading of image is interrupted.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com/code-samples/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/" target="_blank">onblur</a></td>
<td align="left" valign="top">Event happens when an element loses focus.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com/code-samples/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/" target="_blank">onchange</a></td>
<td align="left" valign="top">Event happens when the content of a field is altered.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com/code-samples/onclick-javascript-js-html-dom-objects-event-onclick-javascript-js/" target="_blank">onclick</a></td>
<td align="left" valign="top">Event happens when mouse clicks an object.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com/code-samples/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/" target="_blank">ondblclick</a></td>
<td align="left" valign="top">Event happens when mouse double-clicks an object.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onerror</a></td>
<td align="left" valign="top">Event happens when an error occurs.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onfocus</a></td>
<td align="left" valign="top">Event happens when an element gains focus.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onkeydown</a></td>
<td align="left" valign="top">Event happens when a key is pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onkeypress</a></td>
<td align="left" valign="top">Event happens when key is held down or pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onkeyup</a></td>
<td align="left" valign="top">Event happens when key is released.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onload</a></td>
<td align="left" valign="top">Event happens when an image or page has finished loading.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onmousedown</a></td>
<td align="left" valign="top">Event happens when a mouse button is pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onmousemove</a></td>
<td align="left" valign="top">Event happens when mouse is moved.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onmouseout</a></td>
<td align="left" valign="top">Event happens when mouse is moved off an element.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onmouseover</a></td>
<td align="left" valign="top">Event happens when mouse is moved over an object.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onmouseup</a></td>
<td align="left" valign="top">Event happens when mouse button is released.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onreset</a></td>
<td align="left" valign="top">Event happens when a reset button is clicked.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onresize</a></td>
<td align="left" valign="top">Event happens when a frame or window is resized.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onselect</a></td>
<td align="left" valign="top">Event happens when text is selected.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onsubmit</a></td>
<td align="left" valign="top">Event happens when submit button is clicked.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">onunload</a></td>
<td align="left" valign="top">Event happens when person leaves page.</td>
</tr>
<tr style="font-weight: bold;" align="center">
<td style="width: 100%; background-color: rgb(220, 220, 220); text-align: center;" colspan="2">Mouse/Keyboard Attributes</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">altKey</a></td>
<td align="left" valign="top">Allows access to whether the alt key was pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">button</a></td>
<td align="left" valign="top">Allows you to access which mouse button was pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">clientx</a></td>
<td align="left" valign="top">Allows you to access the horizontal coordinate of the mouse when event was triggered.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">clienty</a></td>
<td align="left" valign="top">Allows you to access the vertical coordinate of the mouse when event was triggered.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">ctrlKey</a></td>
<td align="left" valign="top">Allows you to access whether the control key was pressed.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">metaKey</a></td>
<td align="left" valign="top">Allows you to access whether the meta key was pressed</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">relatedTarget</a></td>
<td align="left" valign="top">Allows you to access the element related to the element that triggered the event.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">screenx</a></td>
<td align="left" valign="top">Allows you to access the horizontal coordinate of the mouse pointer when the event happened.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">screeny</a></td>
<td align="left" valign="top">Allows you to access the vertical coordinate of the mouse pointer when the event happened.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">shiftKey</a></td>
<td align="left" valign="top">Allows you to access the whether the shift key was pressed.</td>
</tr>
<tr style="font-weight: bold;" align="center">
<td style="width: 100%; background-color: rgb(220, 220, 220); text-align: center;" colspan="2">Other Event Attributes</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">bubbles</a></td>
<td align="left" valign="top">Allows access to boolean value that indicates whether event is bubbling event.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">cancelable</a></td>
<td align="left" valign="top">Allows you to access boolean value that shows whether event can prevent default action.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">currentTarget</a></td>
<td align="left" valign="top">Allows you to access the element whose event listeners triggered the event.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">eventPhase</a></td>
<td align="left" valign="top">Allows you to access to which phase of the event flow is being evaluated.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">target</a></td>
<td align="left" valign="top">Allows you to access to element that triggered event.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">timeStamp</a></td>
<td align="left" valign="top">Allows you to access to the timestamp in milliseconds from system start or event trigger.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">type</a></td>
<td align="left" valign="top">Allows you to access the name of the event.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">screenx</a></td>
<td align="left" valign="top">Allows you to access the horizontal coordinate of the mouse pointer when the event happened.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">screeny</a></td>
<td align="left" valign="top">Allows you to access the vertical coordinate of the mouse pointer when the event happened.</td>
</tr>
<tr><!-- Row 1 --></p>
<td align="left" valign="top"><a href="http://idealprogrammer.com" target="_blank">shiftKey</a></td>
<td align="left" valign="top">Allows you to access the whether the shift key was pressed.</td>
</tr>
</tbody>
</table>
<p></center></p>
<p></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/onblur-javascript-js-html-dom-objects-event-onblur-javascript-js/' rel='bookmark' title='Permanent Link: onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example'>onBlur JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onBlur JavaScript JS Example</a> <small>onBlur JavaScript (JS) Example HTML DOM Objects Event...</small></li><li><a href='http://idealprogrammer.com/uncategorized/onchange-javascript-js-html-dom-objects-event-onchange-javascript-js/' rel='bookmark' title='Permanent Link: onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example'>onChange JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; onChange JavaScript (JS) Example</a> <small>onChange JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li><li><a href='http://idealprogrammer.com/uncategorized/ondblclick-javascript-js-html-dom-objects-event-ondblclick-javascript-js/' rel='bookmark' title='Permanent Link: ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example'>ondblclick JavaScript (JS) Example: HTML DOM Objects &#8211; Event &#8211; ondblclick JavaScript (JS) Example</a> <small>ondblclick JavaScript (JS) Example: HTML DOM Objects - Event -...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/html-dom-event-object-examples-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/</link>
		<comments>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 00:13:23 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Button Object]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[value JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1974</guid>
		<description><![CDATA[value JavaScript (JS) Example: HTML DOM Objects - Button Object - value JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-classname-html-dom-objects-button-object-javascript-js-classname/' rel='bookmark' title='Permanent Link: JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example'>JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example</a> <small>JavaSript (JS) className Example: HTML DOM Objects - Button Object...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/Button+Object+value+Property" target="_blank">Button Object value Property </a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Button-object-examples/">View Other Button Object Properties</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> ButtonObject.value=&#034;texttodisplay&#034;  </em> &#8211; Allows you to access the text to display on button.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMButtonObjectProperties.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMButton&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMButton</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMButton&#034; subfolder named &#034;ButtonObjectProperties&#034;
<ul>
<li>Right-click subfolder named &#034;DOMButton&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: ButtonObjectProperties</li>
</ul>
</li>
<li>Add HTML Page Named value to ButtonObjectProperties subfolder
<ul>
<li>Right-click ButtonObjectProperties subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be value</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page value.htm</li>
<li>Right-click on HTML page value.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMButton/ButtonObjectProperties/value.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: value <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myStyle&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #6666ff;">.myButtons</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">large</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButtons</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>Blue</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">xx-small</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-style</span> <span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#d0e4fe</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">600</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Cookie</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li> <span style="color: #003366; font-weight: bold;">function</span> Set_Cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> expires<span style="color: #339933;">,</span> path<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> secure <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li><span style="color: #006600; font-style: italic;">// set time, it's in milliseconds</span></li><li><span style="color: #003366; font-weight: bold;">var</span> today <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>today.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">/*</span></li><li><span style="color: #006600; font-style: italic;">if the expires variable is set, make the correct</span></li><li><span style="color: #006600; font-style: italic;">expires time, the current script below will set</span></li><li><span style="color: #006600; font-style: italic;">it for x number of days, to make it for hours,</span></li><li><span style="color: #006600; font-style: italic;">delete * 24, for minutes, delete * 60 * 24</span></li><li><span style="color: #006600; font-style: italic;">*/</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>expires <span style="color: #339933;">=</span> expires <span style="color: #339933;">*</span> 1000 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">var</span> expires_date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>expires<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;=&quot;</span> <span style="color: #339933;">+</span>escape<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;expires=&quot;</span> <span style="color: #339933;">+</span> expires_date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> path <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;path=&quot;</span> <span style="color: #339933;">+</span> path <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> domain <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;domain=&quot;</span> <span style="color: #339933;">+</span> domain <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> secure <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;secure&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li><span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get Cookie</span></li><li><span style="color: #006600; font-style: italic;">//**************************************************************** </span></li><li><span style="color: #006600; font-style: italic;">// this fixes an issue with the old method, ambiguous values</span></li><li><span style="color: #006600; font-style: italic;">// with this test document.cookie.indexOf( name + &quot;=&quot; );</span></li><li><span style="color: #003366; font-weight: bold;">function</span> Get_Cookie<span style="color: #009900;">&#40;</span>check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// first we'll split this cookie up into name/value pairs</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note: document.cookie only returns name=value, not the other components</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_all_cookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_value <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set boolean t/f default f</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> a_all_cookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// now we'll split apart each name=value pair</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> a_all_cookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// and trim left/right whitespace while we're at it</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// if the extracted name matches passed check_name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cookie_name <span style="color: #339933;">==</span> check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// we need to handle case where cookie has no value but exists (no = sign, that is):</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a_temp_cookie.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_value <span style="color: #339933;">=</span> unescape<span style="color: #009900;">&#40;</span>a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note that in cases where cookie is initialized but no value, null is returned</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> cookie_value<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>b_cookie_found<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>			</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myBodyID&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-color:Yellow;border-color:black;border-style:solid;border-width:1px;&quot;</span>&gt;</span> click Buttons to change value of&nbsp;&nbsp;button object:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #808080; font-style: italic;">&lt;!--using onclick to set a cookie and reload page; </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when page is reloading, we check that cookie to assign different styles to body</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button1 - value=button1&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '1', 30, '/', '', '' ); window.location.reload();&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button2&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button2 - value=button2&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '2', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button3&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button3 - value=button3&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '3', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// DOM Objects</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;Button Object Properties&nbsp;&nbsp; ***</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;object.value=&quot;value&quot;&nbsp;&nbsp;Allows you to retrieve or assign value for the text displayed for a button</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to retrieve value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Two Ways to Retrieve Property for Button1&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementsByTagName</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myObject<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementsByTagName: &quot;</span> <span style="color: #339933;">+</span> myObject.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementById: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to assign value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetById for Button2&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button2 - value=newButton2&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton2&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button2 value changed to value=newButton2: &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementsByTagName</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetElementsByTagName for Button3&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton3&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button3 - value=newButton3&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button3 value changed to value=newButton3: &quot;</span> <span style="color: #339933;">+</span> myThirdButton.<span style="color: #660066;">value</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-classname-html-dom-objects-button-object-javascript-js-classname/' rel='bookmark' title='Permanent Link: JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example'>JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example</a> <small>JavaSript (JS) className Example: HTML DOM Objects - Button Object...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>type JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; type JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/type-javascript-js-html-dom-objects-button-object-type-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/type-javascript-js-html-dom-objects-button-object-type-javascript-js/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 14:00:19 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Button Object]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[type JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1971</guid>
		<description><![CDATA[type JavaScript (JS) Example: HTML DOM Objects - Button Object - type JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/' rel='bookmark' title='Permanent Link: value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example'>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</a> <small>value JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>type JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; type JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/Button+Object+type+Property" target="_blank">Button Object type Property </a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Button-object-examples/">View Other Button Object Properties</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> ButtonObject.type=&#034;button|reset|submit&#034;  </em> &#8211; Allows you to access the type of a Button Object. NOTE: Assigning type cannot be done after element is created. The only way to do it is to create a new element that looks just like the old one and assign a type to the new element.  Then, you replace the original element with the new one.</p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMButtonObjectProperties.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMButton&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMButton</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMButton&#034; subfolder named &#034;ButtonObjectProperties&#034;
<ul>
<li>Right-click subfolder named &#034;DOMButton&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: ButtonObjectProperties</li>
</ul>
</li>
<li>Add HTML Page Named type to ButtonObjectProperties subfolder
<ul>
<li>Right-click ButtonObjectProperties subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be type</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page type.htm</li>
<li>Right-click on HTML page type.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMButton/ButtonObjectProperties/type.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: type <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myStyle&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #6666ff;">.myButtons</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">large</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButtons</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>Blue</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">xx-small</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-style</span> <span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#d0e4fe</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">600</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Cookie</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li> <span style="color: #003366; font-weight: bold;">function</span> Set_Cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> expires<span style="color: #339933;">,</span> path<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> secure <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li><span style="color: #006600; font-style: italic;">// set time, it's in milliseconds</span></li><li><span style="color: #003366; font-weight: bold;">var</span> today <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>today.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">/*</span></li><li><span style="color: #006600; font-style: italic;">if the expires variable is set, make the correct</span></li><li><span style="color: #006600; font-style: italic;">expires time, the current script below will set</span></li><li><span style="color: #006600; font-style: italic;">it for x number of days, to make it for hours,</span></li><li><span style="color: #006600; font-style: italic;">delete * 24, for minutes, delete * 60 * 24</span></li><li><span style="color: #006600; font-style: italic;">*/</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>expires <span style="color: #339933;">=</span> expires <span style="color: #339933;">*</span> 1000 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">var</span> expires_date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>expires<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;=&quot;</span> <span style="color: #339933;">+</span>escape<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;expires=&quot;</span> <span style="color: #339933;">+</span> expires_date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> path <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;path=&quot;</span> <span style="color: #339933;">+</span> path <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> domain <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;domain=&quot;</span> <span style="color: #339933;">+</span> domain <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> secure <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;secure&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li><span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get Cookie</span></li><li><span style="color: #006600; font-style: italic;">//**************************************************************** </span></li><li><span style="color: #006600; font-style: italic;">// this fixes an issue with the old method, ambiguous values</span></li><li><span style="color: #006600; font-style: italic;">// with this test document.cookie.indexOf( name + &quot;=&quot; );</span></li><li><span style="color: #003366; font-weight: bold;">function</span> Get_Cookie<span style="color: #009900;">&#40;</span>check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// first we'll split this cookie up into name/value pairs</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note: document.cookie only returns name=value, not the other components</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_all_cookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_value <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set boolean t/f default f</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> a_all_cookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// now we'll split apart each name=value pair</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> a_all_cookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// and trim left/right whitespace while we're at it</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// if the extracted name matches passed check_name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cookie_name <span style="color: #339933;">==</span> check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// we need to handle case where cookie has no value but exists (no = sign, that is):</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a_temp_cookie.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_value <span style="color: #339933;">=</span> unescape<span style="color: #009900;">&#40;</span>a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note that in cases where cookie is initialized but no value, null is returned</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> cookie_value<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>b_cookie_found<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>			</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myBodyID&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-color:Yellow;border-color:black;border-style:solid;border-width:1px;&quot;</span>&gt;</span> click Buttons to change type of&nbsp;&nbsp;button object:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #808080; font-style: italic;">&lt;!--using onclick to set a cookie and reload page; </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when page is reloading, we check that cookie to assign different styles to button</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button1 - type=button&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '1', 30, '/', '', '' ); window.location.reload();&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button2&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button2 - type=button&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '2', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button3&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button3 - type=button&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '3', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// DOM Objects</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;Button Object Properties&nbsp;&nbsp; ***</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// type</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;object.type=&quot;submit|button|reset&quot;&nbsp;&nbsp;Allows you to retrieve or assign type for button</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// NOTE: Assigning type cannot be done after element is created</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// The only way to do it is to create a new element that</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// looks just like the old one and assign a type to the</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// new element.&nbsp;&nbsp;Then, you replace the original element</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// with the new one </span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to retrieve type</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Two Ways to Retrieve Property for Button1&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementsByTagName</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myObject<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementsByTagName: &quot;</span> <span style="color: #339933;">+</span> myObject.<span style="color: #660066;">type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementById: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">type</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// Two ways to assign type</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// NOTE: Assigning type cannot be done after element is created</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// The only way to do it is to create a new element that</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// looks just like the old one and assign a type to the</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// new element.&nbsp;&nbsp;Then, you replace the original element</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// with the new one </span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//replace original button with new one that has new type</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> input <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button2&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> newInput <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'submit'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">id</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">value</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">replaceChild</span><span style="color: #009900;">&#40;</span>newInput<span style="color: #339933;">,</span> input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//end of replace rtn</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetById for Button2&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton2&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button2 - type=submit&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button2 type changed to submit: &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">type</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementsByTagName</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//replace original button with new one that has new type</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> input <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button3&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> newInput <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">type</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'reset'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">id</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newInput.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> input.<span style="color: #660066;">value</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">replaceChild</span><span style="color: #009900;">&#40;</span>newInput<span style="color: #339933;">,</span> input<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//end of replace rtn</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetElementsByTagName for Button3&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton3&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button3 - type=reset&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button3 type changed to type=reset: &quot;</span> <span style="color: #339933;">+</span> myThirdButton.<span style="color: #660066;">type</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/' rel='bookmark' title='Permanent Link: value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example'>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</a> <small>value JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/type-javascript-js-html-dom-objects-button-object-type-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tabIndex JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; tabIndex JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/tabindex-javascript-js-html-dom-objects-button-object-tabindex-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/tabindex-javascript-js-html-dom-objects-button-object-tabindex-javascript-js/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 21:38:28 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Button Object]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[tabIndex JavaScript]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1967</guid>
		<description><![CDATA[tabIndex JavaScript (JS) Example: HTML DOM Objects - Button Object - tabIndex JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/code-samples/html-dom-objects-anchor-object-javascript-tabindex/' rel='bookmark' title='Permanent Link: JavaScript (JS) tabIndex Example: HTML DOM Objects &#8211; Anchor Object &#8211; JavaScript (JS) tabIndex Example'>JavaScript (JS) tabIndex Example: HTML DOM Objects &#8211; Anchor Object &#8211; JavaScript (JS) tabIndex Example</a> <small>JavaScript (JS) tabIndex Example: HTML DOM Objects - Anchor Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/' rel='bookmark' title='Permanent Link: value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example'>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</a> <small>value JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>tabIndex JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; tabIndex JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/Button+Object+TabIndex+Property" target="_blank">Button Object tabIndex Property </a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Button-object-examples/">View Other Button Object Properties</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> ButtonObject.tabIndex  </em> &#8211; Allows you to access the tabbing order of a Button Object. </p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMButtonObjectProperties.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMButton&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMButton</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMButton&#034; subfolder named &#034;ButtonObjectProperties&#034;
<ul>
<li>Right-click subfolder named &#034;DOMButton&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: ButtonObjectProperties</li>
</ul>
</li>
<li>Add HTML Page Named tabIndex to ButtonObjectProperties subfolder
<ul>
<li>Right-click ButtonObjectProperties subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be tabIndex</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page tabIndex.htm</li>
<li>Right-click on HTML page tabIndex.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMButton/ButtonObjectProperties/tabIndex.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: tabIndex <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myStyle&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #6666ff;">.myButtons</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">large</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButtons</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>Blue</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">xx-small</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-style</span> <span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#d0e4fe</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">600</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Cookie</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li> <span style="color: #003366; font-weight: bold;">function</span> Set_Cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> expires<span style="color: #339933;">,</span> path<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> secure <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li><span style="color: #006600; font-style: italic;">// set time, it's in milliseconds</span></li><li><span style="color: #003366; font-weight: bold;">var</span> today <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>today.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">/*</span></li><li><span style="color: #006600; font-style: italic;">if the expires variable is set, make the correct</span></li><li><span style="color: #006600; font-style: italic;">expires time, the current script below will set</span></li><li><span style="color: #006600; font-style: italic;">it for x number of days, to make it for hours,</span></li><li><span style="color: #006600; font-style: italic;">delete * 24, for minutes, delete * 60 * 24</span></li><li><span style="color: #006600; font-style: italic;">*/</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>expires <span style="color: #339933;">=</span> expires <span style="color: #339933;">*</span> 1000 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">var</span> expires_date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>expires<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;=&quot;</span> <span style="color: #339933;">+</span>escape<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;expires=&quot;</span> <span style="color: #339933;">+</span> expires_date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> path <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;path=&quot;</span> <span style="color: #339933;">+</span> path <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> domain <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;domain=&quot;</span> <span style="color: #339933;">+</span> domain <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> secure <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;secure&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li><span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get Cookie</span></li><li><span style="color: #006600; font-style: italic;">//**************************************************************** </span></li><li><span style="color: #006600; font-style: italic;">// this fixes an issue with the old method, ambiguous values</span></li><li><span style="color: #006600; font-style: italic;">// with this test document.cookie.indexOf( name + &quot;=&quot; );</span></li><li><span style="color: #003366; font-weight: bold;">function</span> Get_Cookie<span style="color: #009900;">&#40;</span>check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// first we'll split this cookie up into name/value pairs</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note: document.cookie only returns name=value, not the other components</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_all_cookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_value <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set boolean t/f default f</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> a_all_cookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// now we'll split apart each name=value pair</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> a_all_cookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// and trim left/right whitespace while we're at it</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// if the extracted name matches passed check_name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cookie_name <span style="color: #339933;">==</span> check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// we need to handle case where cookie has no value but exists (no = sign, that is):</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a_temp_cookie.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_value <span style="color: #339933;">=</span> unescape<span style="color: #009900;">&#40;</span>a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note that in cases where cookie is initialized but no value, null is returned</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> cookie_value<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>b_cookie_found<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>			</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myBodyID&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-color:Yellow;border-color:black;border-style:solid;border-width:1px;&quot;</span>&gt;</span> click Buttons to change tabIndex of&nbsp;&nbsp;button object:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #808080; font-style: italic;">&lt;!--using onclick to set a cookie and reload page; </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when page is reloading, we check that cookie to assign different styles to body</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">tabindex</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button1 - tabIndex=1&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '1', 30, '/', '', '' ); window.location.reload();&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button2&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">tabindex</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button2 - tabIndex=2&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '2', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button3&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">tabindex</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;3&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button3 - tabIndex=3&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '3', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// DOM Objects</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;Button Object Properties&nbsp;&nbsp; ***</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// tabIndex</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;object.tabIndex=&quot;tabIndex&quot;&nbsp;&nbsp;Allows you to retrieve or assign tabIndex for button</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to retrieve tabIndex</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Two Ways to Retrieve Property for Button1&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementsByTagName</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myObject<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementsByTagName: &quot;</span> <span style="color: #339933;">+</span> myObject.<span style="color: #660066;">tabIndex</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementById: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabIndex</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to assign tabIndex</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetById for Button2&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabIndex</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;0&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton2&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button2 - tabIndex=0&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button2 tabIndex changed to tabIndex=0: &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">tabIndex</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementsByTagName</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetElementsByTagName for Button3&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">tabIndex</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;5&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton3&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button3 - tabIndex=5&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button3 tabIndex changed to tabIndex=5: &quot;</span> <span style="color: #339933;">+</span> myThirdButton.<span style="color: #660066;">tabIndex</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/code-samples/html-dom-objects-anchor-object-javascript-tabindex/' rel='bookmark' title='Permanent Link: JavaScript (JS) tabIndex Example: HTML DOM Objects &#8211; Anchor Object &#8211; JavaScript (JS) tabIndex Example'>JavaScript (JS) tabIndex Example: HTML DOM Objects &#8211; Anchor Object &#8211; JavaScript (JS) tabIndex Example</a> <small>JavaScript (JS) tabIndex Example: HTML DOM Objects - Anchor Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js-2/' rel='bookmark' title='Permanent Link: value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example'>value JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; value JavaScript (JS) Example</a> <small>value JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/' rel='bookmark' title='Permanent Link: name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example'>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</a> <small>name JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/tabindex-javascript-js-html-dom-objects-button-object-tabindex-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</title>
		<link>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/</link>
		<comments>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 16:38:05 +0000</pubDate>
		<dc:creator>asp.net videos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Button Object]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[HTML DOM Objects]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JavaScript (JS) Example]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[name]]></category>

		<guid isPermaLink="false">http://idealprogrammer.com/?p=1963</guid>
		<description><![CDATA[name JavaScript (JS) Example: HTML DOM Objects - Button Object - name JavaScript (JS) Example<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>



Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-classname-html-dom-objects-button-object-javascript-js-classname/' rel='bookmark' title='Permanent Link: JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example'>JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example</a> <small>JavaSript (JS) className Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-dir-html-dom-objects-button-object-javascript-js-dir/' rel='bookmark' title='Permanent Link: JavaSript (JS) dir Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) dir Example'>JavaSript (JS) dir Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) dir Example</a> <small>JavaSript (JS) dir Example: HTML DOM Objects - Button Object...</small></li></ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h1>name JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; name JavaScript (JS) Example</h1>
<p><strong>Purpose:</strong> &#8211; Illustrates the <a rel="tag" href="http://technorati.com/tag/javascript+syntax" target="_blank">JavaScript syntax</a> for the  <a rel="tag" href="http://blogs.icerocket.com/tag/Button+Object+name+Property" target="_blank">Button Object name Property </a>.</p>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/code-samples/html-dom-Button-object-examples/">View Other Button Object Properties</a></strong></center></div>
<p><strong>Prerequistes:</strong></p>
<ul>
<li>Install <a href="http://www.msdn.com/express" target="_blank">Visual Web Developer 2008</a></li>
</ul>
<p style="border:thin dotted black; padding:3mm;"><strong>Syntax:</strong> <em> ButtonObject.name  </em> &#8211; Allows you to access the name of a Button Object. </p>
<p><strong>Restrictions:</strong> None </p>
<p><strong>Notes:</strong> </p>
<ul>
<li><font color="red">You can build your own library of syntax examples by using same web site over and over and just add new files to it.</font></li>
</ul>
<p><strong>Instructions:</strong> </p>
<ol>
<li>Use Visual Web Developer 2008</li>
<li>Create new web site;
<ul>
<li>Click File/New Web Site</li>
<li>Select ASP.NET Website Template</li>
<li>Select C-Sharp for language</li>
<li>name of Web Site could be JavaScript_Syntax.</li>
</ul>
</li>
<p><img src="http://idealprogrammer.com/wp-photos/DOMButtonObjectProperties.PNG" alt="Folder" border="1" align="right"/></p>
<li>Add New folder named &#034;HTMLDOMObjects&#034;
<ul>
<li>Right-click project name in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: HTMLDOMObjects</li>
</ul>
</li>
<li>Add New subfolder to &#034;HTMLDOMObjects&#034; folder named &#034;DOMButton&#034;
<ul>
<li>Right-click folder named &#034;HTMLDOMObjects&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: DOMButton</li>
</ul>
</li>
<li>Add New subfolder to &#034;DOMButton&#034; subfolder named &#034;ButtonObjectProperties&#034;
<ul>
<li>Right-click subfolder named &#034;DOMButton&#034; in solution explorer;</li>
<li>add new folder;</li>
<li>name of folder should be: ButtonObjectProperties</li>
</ul>
</li>
<li>Add HTML Page Named name to ButtonObjectProperties subfolder
<ul>
<li>Right-click ButtonObjectProperties subfolder;</li>
<li>add new item;</li>
<li>Select HTML Page</li>
<li>HTML Page name should be name</li>
</ul>
</li>
<li>Click on copy code in code below to copy code into HTML Page name.htm</li>
<li>Right-click on HTML page name.htm and select view in browser</li>
</ol>
<div style="border:thin dotted black; padding:3mm;background-color:gainsboro;"><center><strong><a href="http://idealprogrammer.com/wp-javascript/HTMLDOMObjects/DOMButton/ButtonObjectProperties/name.htm" target="_blank">View Example In Browser</a></strong></center></div>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="HTML"><div class="devcodeoverflow"><ol><li></li><li><span style="color: #009900;">&lt; !DOCTYPE html PUBLIC <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>IdealProgrammer.com: name <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #808080; font-style: italic;">&lt;!-- </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;* This example is from http://idealprogrammer.com *</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;***************************************************</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">style</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myStyle&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #6666ff;">.myButtons</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">large</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #993333;">red</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButtons</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span>Blue</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #993333;">xx-small</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton2</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-style</span> <span style="color: #00AA00;">:</span><span style="color: #993333;">italic</span><span style="color: #00AA00;">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#d0e4fe</span><span style="color: #00AA00;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #6666ff;">.myButton3</span> input</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">600</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00AA00;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">style</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set Cookie</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//****************************************************************&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li> <span style="color: #003366; font-weight: bold;">function</span> Set_Cookie<span style="color: #009900;">&#40;</span> <span style="color: #000066;">name</span><span style="color: #339933;">,</span> value<span style="color: #339933;">,</span> expires<span style="color: #339933;">,</span> path<span style="color: #339933;">,</span> domain<span style="color: #339933;">,</span> secure <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li><span style="color: #006600; font-style: italic;">// set time, it's in milliseconds</span></li><li><span style="color: #003366; font-weight: bold;">var</span> today <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>today.<span style="color: #660066;">setTime</span><span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">/*</span></li><li><span style="color: #006600; font-style: italic;">if the expires variable is set, make the correct</span></li><li><span style="color: #006600; font-style: italic;">expires time, the current script below will set</span></li><li><span style="color: #006600; font-style: italic;">it for x number of days, to make it for hours,</span></li><li><span style="color: #006600; font-style: italic;">delete * 24, for minutes, delete * 60 * 24</span></li><li><span style="color: #006600; font-style: italic;">*/</span></li><li><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span></li><li><span style="color: #009900;">&#123;</span></li><li>expires <span style="color: #339933;">=</span> expires <span style="color: #339933;">*</span> 1000 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> 60 <span style="color: #339933;">*</span> <span style="color: #CC0000;">24</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li><span style="color: #003366; font-weight: bold;">var</span> expires_date <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Date<span style="color: #009900;">&#40;</span> today.<span style="color: #660066;">getTime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span>expires<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>document.<span style="color: #660066;">cookie</span> <span style="color: #339933;">=</span> <span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;=&quot;</span> <span style="color: #339933;">+</span>escape<span style="color: #009900;">&#40;</span> value <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> expires <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;expires=&quot;</span> <span style="color: #339933;">+</span> expires_date.<span style="color: #660066;">toGMTString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> path <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;path=&quot;</span> <span style="color: #339933;">+</span> path <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> domain <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;domain=&quot;</span> <span style="color: #339933;">+</span> domain <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span></li><li><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> secure <span style="color: #009900;">&#41;</span> <span style="color: #339933;">?</span> <span style="color: #3366CC;">&quot;;secure&quot;</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #006600; font-style: italic;">//****************************************************************</span></li><li><span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Get Cookie</span></li><li><span style="color: #006600; font-style: italic;">//**************************************************************** </span></li><li><span style="color: #006600; font-style: italic;">// this fixes an issue with the old method, ambiguous values</span></li><li><span style="color: #006600; font-style: italic;">// with this test document.cookie.indexOf( name + &quot;=&quot; );</span></li><li><span style="color: #003366; font-weight: bold;">function</span> Get_Cookie<span style="color: #009900;">&#40;</span>check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// first we'll split this cookie up into name/value pairs</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note: document.cookie only returns name=value, not the other components</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_all_cookies <span style="color: #339933;">=</span> document.<span style="color: #660066;">cookie</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">';'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> cookie_value <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #003366; font-weight: bold;">var</span> b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// set boolean t/f default f</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> a_all_cookies.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// now we'll split apart each name=value pair</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> a_all_cookies<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// and trim left/right whitespace while we're at it</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// if the extracted name matches passed check_name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>cookie_name <span style="color: #339933;">==</span> check_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;b_cookie_found <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// we need to handle case where cookie has no value but exists (no = sign, that is):</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>a_temp_cookie.<span style="color: #660066;">length</span> <span style="color: #339933;">&gt;</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_value <span style="color: #339933;">=</span> unescape<span style="color: #009900;">&#40;</span>a_temp_cookie<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/^\s+|\s+$/g</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">// note that in cases where cookie is initialized but no value, null is returned</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> cookie_value<span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">break</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a_temp_cookie <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cookie_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>b_cookie_found<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li><span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>			</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span></li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myBodyID&quot;</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background-color:Yellow;border-color:black;border-style:solid;border-width:1px;&quot;</span>&gt;</span> click Buttons to change name of&nbsp;&nbsp;button object:<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #808080; font-style: italic;">&lt;!--using onclick to set a cookie and reload page; </span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when page is reloading, we check that cookie to assign different styles to body</span></li><li><span style="color: #808080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button1&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nameButton1&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button1 - name=nameButton1&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '1', 30, '/', '', '' ); window.location.reload();&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button2&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nameButton2&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button2 - name=nameButton2&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '2', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">input</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Button3&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span>&nbsp;&nbsp;<span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;myButtons&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;nameButton3&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button3 - name=nameButton3&quot;</span> <span style="color: #000066;">onclick</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript: Set_Cookie( 'mycookie', '3', 30, '/', '', '' ); window.location.reload();&quot;</span><span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #000000; font-weight: bold;">br</span> <span style="color: #66cc66;">/</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// DOM Objects</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;***&nbsp;&nbsp;&nbsp;&nbsp;Button Object Properties&nbsp;&nbsp; ***</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//*****************************************************</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;SYNTAX:</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp;&nbsp;&nbsp;object.name=&quot;name&quot;&nbsp;&nbsp;Allows you to retrieve or assign name for button</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to retrieve name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Two Ways to Retrieve Property&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementsByTagName</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myObject<span style="color: #339933;">=</span>document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>0<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementsByTagName: &quot;</span> <span style="color: #339933;">+</span> myObject.<span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Using getElementById: &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button1'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #006600; font-style: italic;">// Two ways to assign name</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>Get_Cookie<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'mycookie'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ButtonNum <span style="color: #339933;">=</span> <span style="color: #3366CC;">'1'</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 1. GetElementById</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'2'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetById&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;nameButton4&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton2&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button2 - name=Button4&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button2 name changed to name=nameButton4: &quot;</span> <span style="color: #339933;">+</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Button2'</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #006600; font-style: italic;">//&nbsp;&nbsp; 2. GetElementsByTagName</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ButtonNum <span style="color: #339933;">==</span> <span style="color: #3366CC;">'3'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;&lt;div style=<span style="color: #000099; font-weight: bold;">\&quot;</span>border-style:solid<span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;&lt;strong&gt;Demonstrating Assigning Property with GetElementsByTagName&lt;/strong&gt;&lt;br /&gt;&quot;</span><span style="color: #009900;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span>2<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #000066;">name</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;nameButton5&quot;</span><span style="color: #339933;">;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;myButton3&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;myThirdButton.<span style="color: #660066;">value</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;button3 - name=nameButton5&quot;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Button3 name changed to name=nameButton5: &quot;</span> <span style="color: #339933;">+</span> myThirdButton.<span style="color: #000066;">name</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;&lt;/div&gt;&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #009900;">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span></li><li><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li>&nbsp;</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Post from: <a href="http://idealprogrammer.com">IdealProgrammer.com</a></p>


<p>Related posts:<ol><li><a href='http://idealprogrammer.com/uncategorized/id-javascript-js-html-dom-objects-button-object-id-javascript-js/' rel='bookmark' title='Permanent Link: id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example'>id JavaScript (JS) Example: HTML DOM Objects &#8211; Button Object &#8211; id JavaScript (JS) Example</a> <small>id JavaScript (JS) Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-classname-html-dom-objects-button-object-javascript-js-classname/' rel='bookmark' title='Permanent Link: JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example'>JavaSript (JS) className Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) className Example</a> <small>JavaSript (JS) className Example: HTML DOM Objects - Button Object...</small></li><li><a href='http://idealprogrammer.com/uncategorized/javasript-js-dir-html-dom-objects-button-object-javascript-js-dir/' rel='bookmark' title='Permanent Link: JavaSript (JS) dir Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) dir Example'>JavaSript (JS) dir Example: HTML DOM Objects &#8211; Button Object &#8211; JavaScript (JS) dir Example</a> <small>JavaSript (JS) dir Example: HTML DOM Objects - Button Object...</small></li></ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://idealprogrammer.com/uncategorized/javascript-js-html-dom-objects-button-object-javascript-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->