Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Style the <td> to only have a border-bottom

Posted on 2008-06-25
1
Medium Priority
?
1,205 Views
Last Modified: 2008-06-25
Through JavaScript I'm able to define the borde style of a <td>-tag by using:
document.getElementById('IDName').style.border = "dashed #123456";

But how do I set the style so that the cell only has a bottom-broder through the use og JavaScript? I've tried the following which gives me an error (Member not found):
document.getElementById('IDName').style = "border-bottom: dashed #123456;";

Here is the html code I would use to give the cell a bottom borser only:
<TD ID='IDName' style='border-bottom-color:#454545; border-bottom-style:dotted;'>
0
Comment
Question by:Tblasters
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
bakuretsu earned 1000 total points
ID: 21866127
In JavaScript, whenever a style attribute has a hyphen in it, you convert it into camelCase to get the JavaScript property. So, in your case, the "border-bottom" attribute in CSS is called "borderBottom" in JavaScript.

I've placed a version of your code repaired down below.
document.getElementById('IDName').style.borderBottom = "1px dotted #454545";

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question