Link to home
Start Free TrialLog in
Avatar of codequest
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!
SOLUTION
Avatar of David S.
David S.
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Not sure what you mean by the question.

You have assigned your object and value - how much shorter do you want it?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of codequest
codequest

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.