Code:
activeCell.onclick = function()
{
console.log(element);
element.value = this.value;
console.log(element.value);
console.log(element);
};
Lets say activeCell is a span with value = "678" but element is just a simple input tag ()
<input id="calendar" value="123" />
The output:
<input id="calendar" value="123">
678
<input id="calendar" value="123">
The string 123 is replaced with 678, but input tag value remains unchanged. However the output value is changed when method setAttribute is used:
element.setAttribute("value", this.value);
I was using the element.value = XXX ever since before and it worked... What are the differences?