如何从不同的页面获取文本框的ID [英] How to get the id of the textbox from different page

查看:126
本文介绍了如何从不同的页面获取文本框的ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我的网页我导航到网址,并尝试使用文本框ID在文本框中添加值,我没有得到请帮助

From my web page i am navigating to url and trying to add value in the textbox using textbox id which i am not getting please help

<script type="text/javascript">
        $(document).ready(function () {
            debugger;
            window.location = "http://faisal.somee.com";
            var textcontrol = document.getElementById("ContentPlaceHolder1_txtName");
            textcontrol.value = "faisal";
        });
   </script>

推荐答案

(document).ready(function(){
debugger;
window。 location =http://faisal.somee.com;
var textcontrol = document.getElementById(ContentPlaceHolder1_txtName);
textcontrol.value =faisal;
});
< / script>
(document).ready(function () { debugger; window.location = "http://faisal.somee.com"; var textcontrol = document.getElementById("ContentPlaceHolder1_txtName"); textcontrol.value = "faisal"; }); </script>


不确定,请尝试使用parent.document.getElementById(ContentPlaceHolder1_txtName);
Not sure, try using parent.document.getElementById("ContentPlaceHolder1_txtName");


这篇关于如何从不同的页面获取文本框的ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆