-
erase Javascript the way innerHTML can Html
Is there a way to erase the javascript between <div> tags; innerHTML="" does not erase the java.
-
-
There shouldn't be any javascript between <div> tags, it belongs between <script> tags. It is rarely necessary to erase javascript though. You can just tell it to stop.
-
-
HTML is set and unchanging. This means that the only way to change it and control it is to use javascript, such as with innerHTML.
Javascript, as programmable code, is great because you can use conditional statements (if, etc.) that allow for the code to act upon certain events or situations.
Javascript is generally run from an event, such as the page loading, the user clicking or typing, or time. As such, you can better choose this event, then you won't need to worry about deleting the actual code.
One great option here would be to use a function, so that the function is only executed when it's called, but isn't actually active in a div, etc.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks