javascript中的基础问题!

guhong 2002-09-04 10:49:59
1〉mbq=document.getelementbyid()有什么用?;
mbq.setattribute()有什么用?
mbq.innerHTML有什么用?
2〉 函数调用中如果参数加了""或''有什么作用?
3〉 object.which有什么用?
object.keycode有什么用?
sorry,我没有工具书,没有查书,请大家帮帮忙,顺便推荐一下网上那里可以找到工具书!谢谢
...全文
51 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
guhong 2002-09-04
  • 打赏
  • 举报
回复
thank 丰臣秀吉!
meizz 2002-09-04
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/library/default.asp

微软的 MSDN 官方网站,这里面你可以查到最新的,最全的MSDN。
老翔 2002-09-04
  • 打赏
  • 举报
回复
getElementById Method

--------------------------------------------------------------------------------

Returns a reference to the first object with the specified value of the ID attribute.

Syntax

oElement = document.getElementById(sIDValue)Parameters

sIDValue Required. String爐hat specifies the value of an ID attribute.

Return Value

Returns the first object with the same ID attribute as the specified value.

Remarks

If the ID value belongs to a collection, the getElementById method returns the first object in the collection.

Example

This example uses the getElementById method to return the first occurrence of the ID attribute value, oDiv.

<SCRIPT>
function fnGetId(){
// Returns the first DIV element in the collection.
var oVDiv=document.getElementById("oDiv");
}
</SCRIPT>
<DIV ID="oDiv">Div #1</DIV>
<DIV ID="oDiv">Div #2</DIV>
<DIV ID="oDiv">Div #3</DIV>
<INPUT TYPE="button" VALUE="Get Names" onclick="fnGetId()">
老翔 2002-09-04
  • 打赏
  • 举报
回复
更正,我在更高级的MSDN中找到了oElement = document.getElementById(sIDValue)这个函数,就是通过HTML元素的ID值,取出你需要的元素。
老翔 2002-09-04
  • 打赏
  • 举报
回复
1)document.getelementbyid(),document没有这个函数。
mbq.setAttribute(attrName , value [, caseSensitive]),是设置和添加一个mbq对象的属性的。(注意大小写)。
mbq.innerHTML,用于取出和设置mbq对象内部的HTML代码的。

2)函数调用中参数用了""或'',代表该参数是字符参数。

3)object.which不知道是什么!没有用过。
object.keyCode[ = keyCode],只能用于event对象。也就是event.keyCode,是一个属性。返回当前键盘相应键的Unicode编码。(注意大小写)

资料都可以在MSDN的帮助光盘三。你只要安装了msdn都可以查到的。




dylanOK 2002-09-04
  • 打赏
  • 举报
回复
查MSDN吧

87,994

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧