I am having a hard executing a chunk of HTML code inside my JavaScript logic, i was wondering if someone could point out what i am doing wrong? What i am trying to achieve is run either video based on probability. Here is my code:
<html>
<head>.</head>
<body>
<script>
function myFunction() {
var chance = (( Math.random()*100)+1)
if (chance>= 0 || chance<=50){
<video controls autoplay name="media">
<source src="http://webmup.com/195a3/vid.webm" type="video/webm">
</video>
}
else {
<video controls autoplay name="media">
<iframe width="420" height="315"
<source src="https://www.youtube.com/embed/IdtKbq3Omkw" type="video/webm">
</ifrmae>
</video>
}
}
</script>
</body>
</html>