473,402 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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

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
2 5946
<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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Timo Nentwig | last post by:
Hi! li { display: inline; } <li>foo bar</li> <li>blah</li>
8
by: Michael | last post by:
This is a two-part question to which I haven't been able to find an answer anywhere else. 1. Is it possible to format the bullet/number character of the <li>? In my styles sheet, I have the <li>...
3
by: NWhite | last post by:
Hi all, I'm trying to indent <li> items using: li { margin: 0 0 0 50px;} So I expect something like the following to indent 50 pixels from the left margin:
4
by: Kerberos | last post by:
I haven't been able to define a fixed width (well, I chose a 20% width) for the li element used in the navigation menu: http://www.auriance.com/docs/auriance/ Style sheet here:...
5
by: Steel | last post by:
Hi at all, please consider this : <ul> <li><a>No link</a></li> <li><a href="#">This is a link</a></li> <li><a>No link</a></li> <li><a href="#">This is a link</a></li> .......................
4
by: Mark | last post by:
Hopefully I 'm missing something silly, but I can't find an easy way to loop all list items in a simple <ol>. I was hoping a for loop as shown below would be enough, however clicking "alert all" in...
4
by: abs | last post by:
Anybody has an idea how to get the <ul> element which is not nested in <li> element ? In other words I have several lists like this: <ul id="1"> <li>Aaaaaaaa</li> <li>Bbbbbbbb</li>...
2
by: Andrew Donaldson | last post by:
I'd welcome some help in understanding what's going on with graphical browsers in the navigation list at: http://www.bounceandtickle.org.uk/index.html (This site is not about what it might...
7
by: patrick j | last post by:
Hi I'm wondering about lists with nested lists as one does on a Saturday afternoon. Anyway below is an example of a list with a nested list which the iCab browser's very useful HTML...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.