EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: officecode on October 30, 2018, 09:45:20 PM



Title: How to judge the current element in the component properties?
Post by: officecode on October 30, 2018, 09:45:20 PM
Hi.
I have multiple input elements here. How can I get the id attribute value of the current element?
The following code is actually wrong, if you use "this.id" in the event, you can get its value!

Code:

$('input').combobox({
url:'getdata.php?hy=' + this.id,
})


Thank you.


Title: Re: How to judge the current element in the component properties?
Post by: stworthy on October 31, 2018, 01:16:27 AM
Assign a class to each <input> elements and then run this code to get each id attribute value.
Code:
$('input.cc').each(function(){
var id = $(this).attr('id');
$(this).combobox({
url: 'getdata.php?hy='+id
})
})