I am new to jQuery and I need some assistance with very simple code. So, I have a string variable that I want to print in the p with listprice class.
<script>
$(document).ready( function() {
var string = "US $257.31";
$('.listprice).append(string);
}
</script>
Any ideas how can I achieve that?
Thank you,
H
You could do this
http://jsfiddle.net/jasongennaro/akpn3/
Of course, this assumes there is nothing in the
pas it would replace everything in there.To add it on a separate line when the
pcontains content, do thishttp://jsfiddle.net/jasongennaro/akpn3/1/
EDIT
As per your comment
You could do this
http://jsfiddle.net/jasongennaro/akpn3/2/
This finds the first
pand adds the variablestring.