Jump to content

move info in and out of javascript


westman

Recommended Posts

hi everyone long time no see ;) so let me get to it... i got php outputing a word or 2 and the word is diffrent every time in a link....

<a href="#" onclick="return false" onmousedown="javascript:boxsetup()"><?php echo $word ?></a>

now how do i get the php word to post to javascript "onmousedown" to put in a div?i have this so fear...

  function boxsetup() { alert("Hello World!");}

the alert box was a test only

Link to comment
Share on other sites

ok the div i would like to send theword to looks like this on my page

<div> <div><div id="title">here is where i need "theword"</div></div></div>

how do i change line...targetelement = document.getElementById("whateveridref");in the code?

Link to comment
Share on other sites

:facepalm: look at this "getElementById" 'get element by id", what about this ""whateveridref" "whatever id ref" Now! where is the ID ref/name
<div id="title">here is where i need "theword"</div>

Please don't reply ' is it "theword" ' "whateveridre"->"whateveridr"->"whateverid"->"whateveri"->"whatever"->"whatevf"->"whatev"->"whate"->"what"->"wha"->"wh"->"w"->""->"t"->"ti"->"######"->"titl"->"title" represents deleting each letter of "whateveridref" then replace, and end up with correct id ref/name, which is.... (the' ######' is what the forum does when it takes the word as being used as Abusive, threatening, defamatory, racist, or obscene.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...