Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get the object name when i pass parameter " this" ?

 
Nakata kokuyo
Ranch Hand
Posts: 467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, is it possible that when we pass a "this" as function parameter, then we can get back the object name ?

for instance,

if we have checkbox field as below


and when user click select or unselect checkbox, and the selectCheckBox(this) function will call .. but then can we get the name of checkbox which is in this case as "chkbox1" ?

thank you for answering
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said before the posts got deleted due to the server problem,

You would just do

function selectCheckBox(xElem){
alert(xElem.name);
}
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic