Hi I have a requirement of printing the value is the popup, I have used the below code
"code"
$('#warning').html('<p style="font-size: 12px;padding-top: 13px;">The updated list value is <p>' + var11);
but i wanted the value 500 to be displayed next to the text in the same line
can some one help me out with this
Thanks
Hi I have a requirement of printing the value is the popup, I have used the below code
"code"
$('#warning').html('<p style="font-size: 12px;padding-top: 13px;">The updated list value is <p>' + var11);
but i wanted the value 500 to be displayed next to the text in the same line
can some one help me out with this
Thanks
Share Improve this question edited Jun 27, 2020 at 16:47 ABGR 5,2454 gold badges32 silver badges55 bronze badges asked Jun 18, 2020 at 6:13 Dodo dodoDodo dodo 592 silver badges9 bronze badges 03 Answers
Reset to default 4Just need to concenenate with +
inside the <p>
tag.
var var11 = 500
$('#warning').html('<p style="font-size: 12px;padding-top: 13px;">The updated list value is ' + var11+'<p>' );
<script src="https://cdnjs.cloudflare./ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="warning"></div>
Hope this helps
Just add the variable to the text of <p>
tag also you can use Template strings:
$('#warning').html(`<p style="font-size: 12px;padding-top: 13px;">The updated list value is ${var11} <p>` );
Get your variable inside the p tag :
$('#warning').html('<p style="font-size: 12px;padding-top: 13px;">The updated list value is' + var11 + ' <p>');