?
Solved

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

Posted on 2008-06-25
1
Medium Priority
?
1,204 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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…
Suggested Courses

765 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