最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - Changin a div border with javascript - Stack Overflow

programmeradmin5浏览0评论

I have created a div programaticaly using.

var Element;
Element = document.createElement('div');

Now I want to change the right and bottom border to "#CCCCCC 1px solid".

I don't want to use a library for this and using CSS classes is not possible.

I have created a div programaticaly using.

var Element;
Element = document.createElement('div');

Now I want to change the right and bottom border to "#CCCCCC 1px solid".

I don't want to use a library for this and using CSS classes is not possible.

Share Improve this question edited May 9, 2010 at 18:40 Jared Updike 7,2868 gold badges48 silver badges73 bronze badges asked Nov 15, 2009 at 1:01 Aaron de WindtAaron de Windt 17.7k14 gold badges50 silver badges67 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 3
element.style.borderRight = element.style.borderBottom = "#CCCCCC 1px solid";
Element.setAttribute("style", "bottom-right: #CCCCCC 1px solid"); ?
发布评论

评论列表(0)

  1. 暂无评论