<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[js直接传入参数的方法极其getElement和getElements分别对应Id和name的区别]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Wed, 16 Mar 2011 11:09:40 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<div class="code"><br/>&lt;form action=&quot;&quot; method=&quot;get&quot;&gt; <br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href=&quot;#&quot; title=&quot;&quot;&gt;&lt;/a&gt;&lt;span id=&quot;search&quot;&gt;&lt;input&nbsp;&nbsp;type=&quot;text&quot; onblur=&quot;if(this.value==&#039;&#039;) this.value=&#039;获奖信息查询&#039;;&quot; onfocus=&quot;if(this.value==&#039;获奖信息查询&#039;) this.value=&#039;&#039;;&quot; value=&quot;获奖信息查询&quot; name=&quot;FQQ&quot; id=&quot;FQQ&quot;&gt;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input name=&quot;&quot; type=&quot;button&quot; class=&quot;button&quot;&nbsp;&nbsp;value=&quot;&quot;&nbsp;&nbsp;onfocus=&quot;this.blur()&quot; onclick=&quot;searchBlueRedZuan(document.getElementById(&#039;FQQ&#039;).value);&quot;&gt;&lt;/span&gt;<br/>&nbsp;&nbsp; &lt;/h2&gt;&lt;/form&gt;<br/></div><br/><br/>JavaScript中document.getElementsByName(name)[0]的意思。<br/>一般经常见到document.getElementsByName(name)，末尾再加上“[0]”是为何意？document.getElementsByName(name)一定是数组吗？假如html文件中已确定只有一个变量的名字为name，那么是不是仍然要加&quot;[0]&quot;？<br/><br/>document.getElementsByName(name)是取得页面中标签名属性名为name的标签对象,此处的name是一个变量,具体值根据上下文来确定.标签允许name属性名可以同名,所以用此方法取得的往往是一个集合(数组),所以用后面加[0](如果多个还可以1,2等)来得到具体的值.如:<br/>&lt;a name=c1&gt;...<br/>&lt;p name=c1&gt;...<br/>&lt;input name=c2&gt;...<br/>使用document.getElementsByName(”c1“)[0]将获得a对象,document.getElementsByName(”c1“)[1]获取p标签对象.<br/><br/>注意：加在c1上的双引号是英文状态下的，现在例子中使用了全角的，因为百度新平台有点问题，会过滤掉带双引号的内容。<br/><br/>DCshi的这个,注意它是一个数组，通过下标0加点getAttribute来获取值：<br/><div class="code"><br/>document.getElementsByName(&quot;FQQ&quot;)&#91;0&#93;.getAttribute(&quot;value&quot;)<br/></div><br/><br/><br/>&lt;script&gt;<br/>document.getElementById(&quot;newid&quot;).onclick=function()&#123;alert(this.value);&#125;<br/>&lt;/script&gt;<br/><br/> 来源：http://zhidao.baidu.com/question/199450007.html
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] js直接传入参数的方法极其getElement和getElements分别对应Id和name的区别]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>