Solved

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

Posted on 2008-06-25
1
1,200 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 250 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
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…

736 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