2012-03-24 53 views

回答

0

我很肯定<input type="password" value="value" />適用於大多數瀏覽器。

0

看看這裏http://www.w3schools.com/html/html_forms.asp。使用type="password"代替type="input"

+0

我知道如何獲得密碼類型的變量works.And概念field.My問題是我在登錄我的一個站點,在鏈路的點擊我要到其他網站,現在在第二現場我想填寫登錄名和密碼 – 2012-03-24 10:27:18

0

假設你有一個輸入框:

<input type="password" name="ooxx" /> 

和使用jQuery,你可以在運行時將其值設置:

// 333 is the new value 
jQuery("input[type='password']").val(333) 

在這裏看到的活生生的例子: http://jsfiddle.net/AeJjy/

此外,您可以使用下面的方法從url獲取值。

/** 
* Usage: given : http://some.site.com?para1=hi 
* para1 = params("para1")  => para1 = "hi" 
* @param {Object} name 
*/ 
function params(name) 
{ 
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); 
    var regexS = "[\\?&]"+name+"=([^&#]*)"; 
    var regex = new RegExp(regexS); 
    var results = regex.exec(window.location.href); 
    if(results == null) 
    return ""; 
    else 
    return results[1]; 
} 
+0

Siwei Shen @在我的情況下不工作 – 2012-03-24 10:59:57

+0

@SonelalSingh您可以在調試時打開螢火蟲,看看它是什麼錯誤? – 2012-03-24 11:10:32

+0

沒有錯誤生成....在控制檯 – 2012-03-28 10:07:16

相關問題