0

i have came across some challenge trying to generate text in another html page after clicking pagetext on initial page in the same site. Below is the set code - a script on the initial index page. Upon clicking the element i would like the text to be changed on details.html page (in this case just print "Goodbye") for testing first.

How can i tell javascript/jscript to change text on the element #dtitle on the other page?

$('details.html #dtitle')

this one obviously doesnt work - only moves to the second page. Is there any syntax?

function toTransit() {
    location.href='details.html';
    $('details.html #dtitle').html('Goodbye');          
};

Thanks.

Artis Universe
  • 153
  • 1
  • 2
  • 11
  • _"How can i tell javascript/jscript to change text on the element #dtitle on the other page?"_ You can't. You'll need to _at least_ run some javascript on the following page, plus [utilise a method to pass the text you want from the first page to the next](http://stackoverflow.com/questions/7267519/how-can-i-pass-a-value-from-one-html-page-to-another-using-javascript). – James Thorpe Jan 06 '16 at 14:17
  • thank you for you reply. – Artis Universe Jan 06 '16 at 15:17

0 Answers0