JQuery Cast to String
value.toString()
String(value)
value + ""
Old-fashioned Octopus
value.toString()
String(value)
value + ""
var $elem = $('<a href="#">Some element</a>');
console.log("HTML is: " + $elem.get(0).outerHTML);
function myFunction() {
var y = document.getElementById("txt1").value;
var z = document.getElementById("txt2").value;
var x = parseInt(y) + parseInt(z);
// document.getElementById("demo").innerHTML = x;
document.getElementById("txt3").value= x;
var elem = document.querySelector('#txt3');
if(x < 50)
// Set color to purple
elem.style.color = 'red';
else
// Set color to purple
elem.style.color = 'green';
}
alart("Hello");