1var $elem = $('<a href="#">Some element</a>');
2console.log("HTML is: " + $elem.get(0).outerHTML);
1function myFunction() {
2 var y = document.getElementById("txt1").value;
3 var z = document.getElementById("txt2").value;
4 var x = parseInt(y) + parseInt(z);
5 // document.getElementById("demo").innerHTML = x;
6 document.getElementById("txt3").value= x;
7 var elem = document.querySelector('#txt3');
8
9 if(x < 50)
10// Set color to purple
11elem.style.color = 'red';
12 else
13 // Set color to purple
14elem.style.color = 'green';
15 }
16
17