Javascript variable = variable -


Is there a way to create variables in Java always a variable? As var1 = var2 , but when var2 updates, such a var1 does.

Example

  var var1 = document.getElementById ("Demo"). Style.color; Var var2 = "blue"; Var1 = var2; Var2 = "red"; / Var1 update for red when the run up statement   

edit:

The actual code I am using code is & lt; Progress & gt; element value attribute, and var2 will not have a number one string.

In Javascript, if you want to preserve the context of values, Can be used.

  var obj1 = {}; Var obj2 = obj1; // obj1 and obj2 both point obj1.b = document on an object.getElementById ("demo"). Style.color; Obj2.b = "blue"; // Both obj1.b and obj2.b are "blue" now    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -