欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js設(shè)置文本框中焦點(diǎn)位置在最后的示例代碼(簡(jiǎn)單實(shí)用)

 更新時(shí)間:2014年03月04日 09:24:33   作者:  
本篇文章主要是對(duì)js設(shè)置文本框中焦點(diǎn)位置在最后的示例代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助

在火狐瀏覽器中直接使用this.focus();即可實(shí)現(xiàn)。

在IE中,在this.focus();之后再把文本框的值賦給文本框,焦點(diǎn)即在最后了。很簡(jiǎn)單喲??!

如:

復(fù)制代碼 代碼如下:

var tar=document.getElementByIdx_x("name");
if(tar.attachEvent){
tar.attachEvent('onmouseover',focus(tar),false);
}else{
tar.addEventListener('mouseover',focus(tar),false);
}
function focus(tar){

    tar.focus();
    tar.value=tar.value;
}

相關(guān)文章

最新評(píng)論