By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

How do you change the width parameter of an <li> element?

P: n/a
Hello everyone,

Anyone know how can I change the 30px below to a different value from
a javascript function?

<table>
<tr>
<td>
<div id="star-rating">
<ul>
<li id="id1" name="name1" class="current" style="width:30px;"></
li>
</ul>
</div>

Any help would be greatly appreciated!

Mike

Mar 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
<mi*************@yahoo.comwrote in message
news:11*********************@y80g2000hsf.googlegro ups.com...
Hello everyone,

Anyone know how can I change the 30px below to a different value from
a javascript function?

<table>
<tr>
<td>
<div id="star-rating">
<ul>
<li id="id1" name="name1" class="current" style="width:30px;"></
li>
</ul>
</div>

Any help would be greatly appreciated!
You can either change the style object's width attribute or assign a class to it via
className.

http://www.irt.org/xref/style.htm

However, I would be remiss if I did not mention that you can change the width of the
element using the pseudo-class :hover.

-Lost
Mar 23 '07 #2

P: n/a

mi*************@yahoo.com wrote:
<li id="id1" name="name1" class="current" style="width:30px;"></
li>
document.getElementById("id1").style.width = "100px";

Mar 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.