jquery cast to string
value.toString()
String(value)
value + ""
jquery cast to string
value.toString()
String(value)
value + ""
convert jquery to string
var $elem = $('<a href="#">Some element</a>');
console.log("HTML is: " + $elem.get(0).outerHTML);
how to convert variable to string in jquery
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';
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us