Board logo

标题: [问题求助] 麻烦同学们帮忙用VBS获取网页上指定按钮的属性值[已解决] [打印本页]

作者: vinespn    时间: 2015-7-29 15:54     标题: 麻烦同学们帮忙用VBS获取网页上指定按钮的属性值[已解决]

本帖最后由 pcl_test 于 2017-4-4 18:28 编辑

大家好,最近学着个VBS和Html,自己写了小段代码,功能是文本框内显示当前鼠标停留所在按钮的Name属性。
代码如下,用的是Javascript 实现的,由于在学习VBS,也希望能用VBS实现这个功能,麻烦大家指点一二。
拜谢。
  1. <html>
  2. <head>
  3. <script  type=text/javascript>
  4. function muson(obj){
  5. T1.value = obj.name
  6. }
  7. function musout(obj){
  8. T1.value = ""
  9. }
  10. </script>
  11. </head>
  12.   <body>
  13. <input type= "Button" name ="add"    value="添加"  onmousemove="muson(this)" onMouseOut="musout(this)" />
  14. <input type= "Button" name ="delete" value="删除"  onmousemove="muson(this)" onMouseOut="musout(this)" />
  15. <input type= "Button" name ="update" value="修改"  onmousemove="muson(this)" onMouseOut="musout(this)" />
  16. <input type= "Button" name ="search" value="查找"  onmousemove="muson(this)" onMouseOut="musout(this)" />
  17. <input type= text   name ="T1" >
  18.   </body>
  19. </html>
复制代码

作者: vinespn    时间: 2015-7-29 17:06

  1. <html>
  2. <head>
  3. <script   language=vbscript>
  4. </script>
  5. </head>
  6.   <body>
  7. <input type= "Button" name ="M4000" value="添加"  onmousemove=T1.value="m4000" onMouseOut=T1.value="" />
  8. <input type= "Button" name ="M4001" value="删除"  onmousemove=T1.value="m4001" onMouseOut=T1.value="" />
  9. <input type= "Button" name ="M4002" value="修改"  onmousemove=T1.value="m4002" onMouseOut=T1.value="" />
  10. <input type= "Button" name ="M4003" value="查找"  onmousemove=T1.value="m4003" onMouseOut=T1.value="" />
  11. <input type= "Button" name ="M4004" value="刷新"  onmousemove=T1.value="m4004" onMouseOut=T1.value="" />
  12. <input type= text   name ="T1" >
  13.   </body>
  14. </html>
复制代码
走了一天的弯路,




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2