i have javascript jquery that looks like this:
var userInput = prompt("Liquid Handler #:", "Liquid Handler #:");
$(this).next('a').text('Liquid Handler #:' + userInput);
i would like to know how i can include html into the text something like this:
var userInput = prompt("Liquid Handler #:", "Liquid Handler #:");
$(this).next('a').text('Liquid Handler #:' + '<b>' + userInput + </b>);
how do i inject html into the javascript?
Use .html instead of .text.
$(this).next('a').html('Liquid Handler #:<b>' + userInput + '</b>');
jQuery's .html() method should help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With