EasyUI Forum
September 15, 2025, 02:52:25 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to judge the current element in the component properties?  (Read 4853 times)
officecode
Jr. Member
**
Posts: 69


View Profile Email
« 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.
« Last Edit: October 30, 2018, 09:48:21 PM by officecode » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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
})
})
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!