I just want to know how can i link two variables in jquery using .link() http://api.jquery.com/link/.
I have two variable var name; and var firstname; , i should link "name" to "firstname". If i made any changes to "name" means it should reflect in "firstname" and vise versa.
I don't have much experience with the link()
plugin for jQuery, but it seems that that plugin is designed more for linking user interface elements to variables in Javascript, not for linking two variables together so that when one changes value the second one will follow suit.
What are you trying to do exactly? The point of variables would be to contain, well, variable data, and if you're trying to access a variable called firstname
which would be adjusted by another variable in its scope called name
, then you could (and should) rather just access the name
variable directly, and not attempt to create copies of variables.