I need to print a var in a jQuery .html() function.. How do i do this?
.html('<table><tr><td><!-- VAR PRINT HERE? --></tr></td>')
Assuming your variable is in JavaScript:
.html('<table><tr><td>' + variable_name_here + '</tr></td>')
This simply concatenates (adds, glues together) the first string, then your variable, then the second string.
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