The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Need help with <object>, button not working
slo-typa101
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 15 2015, 07:25 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,649
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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 16th April 2024 - 04:07 PM