type 属性返回选中项的类型。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>document.selection 的 type</title> </head> <body> <div>请选中文字</div> <div><input type="button" value="然后点击这里" onclick="javascript:alert('type是:'+document.selection.type);" /></div> <hr /> <div><input type="button" value="请选中按钮" /></div> <div><input type="button" value="然后点击这里" onclick="javascript:alert('type是:'+document.selection.type);" /></div> </body> </html>[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
创建于2005年 渝ICP备05010272号-1
电邮:cftea@126.com