Reputation: 10981
I have the following code which works fine, however I wanted to know if there is a better way to add the <br>'s
Is there a better more efficient way to do it.
<script type="text/javascript" language="javascript">
$(function(){
$('#pt656').after($("input[name='btnaddtocart']"));
$('#pt656').after('<br><br>');
});
</script>
Upvotes: 1
Views: 699
Reputation: 1077
You can add space between elements with CSS. Following adds 20px space between elements #pt656
and btnaddtocart
.
<script type="text/javascript" language="javascript">
$('#pt656').after($("input[name='btnaddtocart']").css('margin-top', '20px'));
</script>
Upvotes: 2