首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

正则取值name="xxxx"解决办法

2012-02-02 
正则取值namexxxx使用正则取出 inputtype text name xxxx /中name的value [解决办法] script

正则取值name="xxxx"
使用正则取出 <input   type= "text "   name= "xxxx "/>

中name的value


[解决办法]
<script type= "text/javascript ">
var name_p =/ <input[\S\s]+?name=\ "([^\ "]+)\ "[^> ]+> /i;
var name = ' <input type= "text " name= "xxxx "/> '.match(name_p)[1];
alert(name);
</script>

热点排行