0

I am trying to add a href link to the words "privacy policy" in the text shown below.

I have tried adding the <a href="">privacy policy</a> in the line and also tried "see our " + "<a href="">privacy policy</a>" + " for..."

And then tried making a variable containing the link and adding it in place of the code above: + "<a href="">privacy policy</a>" +

But neither would work, the line would just disappear.

jQuery(document).ready(function( $ ){
   $( ".classname" ).after( "<p>Your details will be used to process the tickets. We take users’ privacy very seriously, see our privacy policy for full details on how we use your data.</p>" );
});

Is there a simple way to do this?

****Attempted Code****

jQuery(document).ready(function( $ ){
   $( ".classname" ).after( "<p>Your details will be used to process the tickets. We take users’ privacy very seriously, see our <a href="'https://google.com'" target="'_blank'" rel="noopener noreferrer">privacy policy</a> for full details on how we use your data.</p>" );
});
jQuery(document).ready(function( $ ){
   $( ".classname" ).after( "<p>Your details will be used to process the tickets. We take users’ privacy very seriously, see our <a href="https://google.com" target="_blank" rel="noopener noreferrer">privacy policy</a> for full details on how we use your data.</p>" );
});
freedomn-m
  • 27,664
  • 8
  • 35
  • 57
Jordan
  • 1
  • 4
  • 2
    All of the options must work fine, that means your problem may come from elsewhere, try to share with us your attempts code. – Zakaria Acharki Jun 12 '19 at 10:48
  • 1
    Be careful not to use `"` inside `"` - your IDE should be making it obvious where you've terminated your string. If you're not using an IDE then copy your code to somewhere that does syntax highlighting (eg snippet here, jsfilddle, jslint). `"see our " + "' + " for ..."` or `"see our " + "" + " for ..."` – freedomn-m Jun 12 '19 at 10:53
  • Re edit: you should be able to see where the text changes colour: red for a string, black for code, grey for a code comment. – freedomn-m Jun 12 '19 at 10:54
  • Thanks @freedomn-m that has worked, I was doing the development in the page, so no syntax highlighting, etc. Thanks for helping. – Jordan Jun 12 '19 at 10:56

0 Answers0