Forums

This topic is locked

change value inside link tag

Posted 09 Feb 2007 08:08:39
1
has voted
09 Feb 2007 08:08:39 LorD ExoskeletoN posted:
hi dear experts....i have a problem on how to change value inside link tag, href in particular! please try to look at this:

<pre id=code><font face=courier size=2 id=code>

&lt;script language="JavaScript" type="text/javascript"&gt;
&lt;!--
function css_style(css_choice) {


document.getElementById("css_style".innerHTML="css_styles/style"+css_choice+".css";


}
--&gt;
&lt;/script&gt;


&lt;link href="&lt;div id=css_style&gt;&lt;/div&gt;" rel="stylesheet" type="text/css"&gt;
</font id=code></pre id=code>

i know it wont work but i want it this way to happen ... placing a value in the href portion of the link tag!


i know how to place a value if div tag alone...but in this case ...any idea? is this possible?

please help...TIA



<center>
afraid NOT to FAIL for you learn NOTHING

www.nasbikesphilippines.bravehost.com
<img src="www.motorcyclephilippines.com/forums/signaturepics/sigpic14460_2.gif" border=0></center>

Edited by - exoskeleton on 09 Feb 2007 09:02:05

Replies

Replied 09 Feb 2007 19:01:16
09 Feb 2007 19:01:16 Alan C replied:
I'm no good with javascript, but here's a snippet from one of my pages

&lt;td width="12%"&gt;&lt;a href="list_events2.php?sortBy=&lt;?php echo $_GET['startDate']; ?&gt;"&gt;Start date &lt;/a&gt;&lt;/td&gt;

&lt;td width="10%"&gt;&lt;a href="list_events2.php?sortBy=&lt;?php echo $_GET['cityName']; ?&gt;"&gt;City&lt;/a&gt;&lt;/td&gt;

the php inserts into the links fine, it makes the table headings into links that call the same file with a different query to sort the table according to the header tow - is that the kind of thing you want?

Not sure if that will show properly as the box says HTML is OFF at the left

Reply to this topic