<?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>Open Source Web &#187; JavaScript</title>
	<atom:link href="http://www.open-source-web.com/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.open-source-web.com</link>
	<description>Your open source for Development and Design</description>
	<lastBuildDate>Sun, 22 Aug 2010 19:08:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Javascript click() method</title>
		<link>http://www.open-source-web.com/javascript/javascript-click-method/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-click-method/#comments</comments>
		<pubDate>Sat, 06 Jun 2009 14:04:44 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=148</guid>
		<description><![CDATA[Javascript has evolved into a great web programming language over the last few years with its compatibility getting much greater then it was and with the versatility of the script. This week I came back to a script I wrote some time ago using a frame work. The script basically allowed the visitor to click [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript has evolved into a great web programming language over the last few years with its compatibility getting much greater then it was and with the versatility of the script.</p>
<p>This week I came back to a script I wrote some time ago using a frame work. The script basically allowed the visitor to click next or previous and scroll through a list element. Although dynamic HTML is pretty awesome it can be hard to maintain.</p>
<p>Due to requirements the scroll er has had to be automated as well as respond to a users click which it wasn&#8217;t built for, At first it may need to be re written from scratch but then I came across the click() method.</p>
<p>Click() basically simulates a users click on a button in javascript. Unfortunately it only works with form button elements and not with elements such as hyperlinks.</p>
<p>If you need to simulate the click of another type of element I would suggest making a button and giving it the style display:none;</p>
<p>example usage</p>
<p>getElementByID(&#8216;someid&#8217;).click();</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-click-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript get element by id</title>
		<link>http://www.open-source-web.com/javascript/javascript-get-element-by-id/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-get-element-by-id/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 21:36:16 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[getlementbyid]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=132</guid>
		<description><![CDATA[Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. Javascript has also evolved over the years with the DOM it has become much easier to develop. One useful piece of code I always end up using when writing Javascript is getElementById, the way [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript is probably the most awesome tool a web developer can use to make a website both functional and look nice. <strong>Javascript </strong>has also evolved over the years with the DOM it has become much easier to develop.</p>
<p>One useful piece of code I always end up using when writing Javascript is <strong>getElementById</strong>, the way Javascript evolved has given it much more compatibility with different browsers and in turn means you need less code to do more.</p>
<p><strong>getElementById</strong> allows you to modify any html element with a given ID. so for example if you have a &lt;div&gt; with the ID jstest it might look like this</p>
<p>&lt;div id=&#8221;jstest&#8221;&gt;howdy&lt;/div&gt;</p>
<p>Using <strong>document.getElementById(&#8216;jstest&#8217;)</strong> we can modify this element dynamically with javascript changing anything from its appearance or position with styling or use it within our javascript code.</p>
<p>using <strong>document.getElementById(&#8216;jstest&#8217;).innerHTML</strong> we could change or get the contents of the div.</p>
<p>Another pretty awesome use for the getElementById method would be to change the style of an element dynamically, maybe you want it to disappear when clicked or have a border when highlighted.</p>
<p>To change the background of an element we could use document.getelementById(&#8216;jstest&#8217;).style.background-color = &#8216;#dedede&#8217;  this will work with any styling you could apply to an element.</p>
<p>If you are like 90% of the old school web developers I know you probably don&#8217;t like using javascript but the modern DOM it is couldn&#8217;t be easier.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-get-element-by-id/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript Input box control</title>
		<link>http://www.open-source-web.com/javascript/javascript-input-box-control/</link>
		<comments>http://www.open-source-web.com/javascript/javascript-input-box-control/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 20:50:45 +0000</pubDate>
		<dc:creator>Adi</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[input]]></category>

		<guid isPermaLink="false">http://www.open-source-web.com/?p=5</guid>
		<description><![CDATA[The idea behind this was to aid design and usability by adding a label inside the input box to give an indication of what it was for. It might not be a search box, maybe you want to add labels for name and address boxes who knows. Click the input box below and see how [...]]]></description>
			<content:encoded><![CDATA[<p>The idea behind this was to aid design and usability by adding a label inside the input box to give an indication of what it was for. It might not be a search box, maybe you want to add labels for name and address boxes who knows.</p>
<p>Click the input box below and see how the &#8220;search&#8221; disappears leaving it empty for the user to edit. If the user clicks and clicks off leaving it empty the label will return to &#8220;Search&#8221;</p>
<p><code><br />
<script type="text/javascript">
function out(){
	if(document.getElementById('test').value == ''){
	document.getElementById('test').value = 'Search...';
	}
}
</script></p>
<form>
<input name="test" id="test" value="Search..."onclick="document.getElementById('test').value='';"onblur="out();"/></form>
<p></code></p>
<p>Here is how it works.</p>
<p>A basic Javascript function to control the input box called &#8220;test&#8221;  This function basicaly says. Check if the box is empty, if it is make it&#8217;s value &#8220;Search&#8221;.<br />
The input box also calls Javascript &#8220;onclick&#8221; to clear the input and &#8220;onblur&#8221; to call the function below.</p>
<pre name="code" class="php">
<script type="text/javascript">
function out(){
	if(document.getElementById('test').value == ''){
	document.getElementById('test').value = 'Search...';
	}
}
</script>
<form>
<input name="test" id="test" value="Search..."
onclick="document.getElementById('test').value='';"
onblur="out();"
/>
</form>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.open-source-web.com/javascript/javascript-input-box-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
