Need help with <object>, button not working |
Need help with <object>, button not working |
slo-typa101 |
May 14 2015, 10:52 PM
Post
#1
|
Group: Members Posts: 1 Joined: 14-May 15 Member No.: 22,593 |
Hi im doing a lil mock up for fun. I made this button and it worked fine until i added some objects pls help. Heres my code
<!DOCTYPE html> <html> <head> <style> body{ background-color:lightgrey;} h1{ color: black; font-family:futura; } #b1{ position: absolute; top:450px; left:299px; } #load_mid{ position: fixed; top:95px; left:310px; } #bar{ padding-left:300px; } #d_bottom{ position: absolute; top:90px; left:330px; } </style> </head> <body> <h1>Test</h1> <button id="b1">test me!</button> <p id= "trial"></p> <object type="images/svg+xml" data="images/bar.svg" id="bar" ></object> <object type="images/svg+xml" data="images/display-bottom.svg" id="d_bottom" ></object> <object type="images/svg+xml" data="images/display-load-graph.svg" id="load_mid" ></object> <script> document.getElementById("b1").addEventListener("click", function(){ document.getElementById("trial"). innerHTML= Date(); }); </script </body> </html> |
Christian J |
May 15 2015, 07:25 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,659 Joined: 10-August 06 Member No.: 7 |
The </script> end tag is broken.
As a sidenote, the OBJECT element has never been properly supported IIRC, but I don't think it matters for the script. |
Lo-Fi Version | Time is now: 26th April 2024 - 04:59 PM |