codequest
asked on
Shorter JQuery
How might I shorten / improve / make more efficient this code to fill these two variables?
// the object
var wrkEvalType = $("#" + "YXZ").first()
// the value of the object
var wrkText = $("#" + "YXZ").first().text()
Help appreciated.
Thanks!
// the object
var wrkEvalType = $("#" + "YXZ").first()
// the value of the object
var wrkText = $("#" + "YXZ").first().text()
Help appreciated.
Thanks!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the direction on this. I appreciate in retrospect it wasn't that complicated; I was apparently feeling pretty fuzzy about JQuery at the time I asked, and the answers provided clarity in several ways.
You have assigned your object and value - how much shorter do you want it?