【发布时间】:2011-09-02 21:55:01
【问题描述】:
我不太确定应该如何获取顶部 URL,然后将其放入文本输入中?这是我想出的,但没有运气。谁有想法?另外,我怎样才能使这个文本输入不可编辑?
<script type="text/javascript">
var topURL = document.URL;
function SelectAll(id)
{
document.getElementById(id).focus();
document.getElementById(id).select();
}
</script>
<input type="text" id="txtfld" onClick="SelectAll('txtfld');" style="width:200px" value ="topURL" />
我也在value参数中尝试了value ="document.URL"和value ="document.write(document.URL)"
【问题讨论】:
标签: javascript html forms url