•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,539 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,158 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1022 | Replies: 1
![]() |
| |
CSS class not applying properly
I have created som code that allows a user to create an object by clicking a button.
It's working fine.
However, I have a CSS class called "draggable" (which makes the object draggable).
If I apply the class to a hand-coded object:
It is draggable.
But the objects created by this script:
Are not draggable. Any ideas?
Here's the code in its entirety:
Thanks!
I have created som code that allows a user to create an object by clicking a button.
It's working fine.
However, I have a CSS class called "draggable" (which makes the object draggable).
If I apply the class to a hand-coded object:
<form action="#">
<input type="radio" CLASS="draggable" name="radio" id="radio" />
</form>It is draggable.
But the objects created by this script:
function makeradio(){
var newElem= document.createElement("input")
newElem.type = "radio"
document.forms[2].appendChild(newElem);
newElem.setAttribute("class", "draggable")
}Are not draggable. Any ideas?
Here's the code in its entirety:
<html>
<head>
<script language="JavaScript">
function makeradio(){
var newElem= document.createElement("input")
newElem.type = "radio"
document.forms[2].appendChild(newElem);
newElem.setAttribute("class", "draggable")
}
</script>
</head>
<body>
<form>
<input type="button" src="images\radio_button.gif" onclick="makeradio();" >
</form>
<br>
<form>
</form>
</body>
</html>
Thanks!
Last edited by Tom Tolleson : Oct 11th, 2007 at 12:03 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- css not working in IE (HTML and CSS)
- Why do people wish for tableless with CSS? (HTML and CSS)
- CSS & menu (HTML and CSS)
- HTML-CSS trouble (HTML and CSS)
- css to make navigation bar (HTML and CSS)
- new window in Internet Explorer is always blank (Web Browsers)
- Css ? (HTML and CSS)
- CSS Quicky (HTML and CSS)
- Internet Explorer Mess.. (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Window Scroll Position
- Next Thread: Hint Box using Ajax with Php


Hybrid Mode