jquery - How can I add some html to an exact position within a page? -
i trying figure out how add :
<p id="sab-contact-tab"><a href="/contact" class="smcf-link"></a></p>
right after :
<div id="footer">
here code:
jquery(document).ready(function() { var prependhtml = "<p id="sab-contact-tab"><a href="/contact" class="smcf-link"></a></p>"; jquery(prependhtml).prepend("#footer"); });
is code correct? if not right code?
thanks,
michael sablatura
var prependhtml = "<p id="sab-contact-tab"><a href="/contact" class="smcf-link"></a></p>";
should
var prependhtml = '<p id="sab-contact-tab"><a href="/contact" class="smcf-link"></a></p>';
or
var prependhtml = "<p id=\"sab-contact-tab\"><a href=\"/contact\" class=\"smcf-link\"></a></p>";
Comments
Post a Comment