<input type="text" name="address4" id="address4" onFocus="open1(this);">
函數則加一個對象
function open1(ob)
{
var id=$(ob).attr("id");
alert(id);
}ajax
<>=======================函數
/*
* 獲取全部選擇的ids
*/
function getSelectedIds(){
var ids = "";
$("input[name='ids']:checked").each(function (i, o) {
ids += $(this).val();
ids += ",";
});
if (ids.length < 1 ) {
return false;
}
ids = ids.substring(0,ids.length-1);
return ids;
}
/*
* url追加ids
*/
function getURLAppendIDs(ob){
var ids =getSelectedIds();
if(ids.length>0){
var url =($(ob).attr("action"))+"?id="+ids;
$(ob).attr("action",url);
}
}this
<input type="button" id="netease" value="網易綁定" onclick="getURLAppendIDs(this)" class="button btn-green" action="/ecloud/yneteasebinding/create.do" target="ajaxTodo" />url