Bla*_*ess 0 html javascript jquery
所以我试图传递输入ID并获取其相应的类型.
例如.
<input id = "1" type = "date"/>
<input id = "2" type = "text"/>
Run Code Online (Sandbox Code Playgroud)
所以传递"1"将返回日期,传递"2"将返回文本.
我看了几个例子,但没有一个适用于我的案例:
到目前为止我所拥有的:
$("#my_select").on('click',function(){
var fieldID = document.querySelector('.selected').id
console.log("id is " + fieldID);
var elementType = $(this).prev().prop('.selected');
console.log("element type " + elementType)
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
93 次 |
| 最近记录: |