how do i fix my pause and play button not working when clicked? [closed] - html

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 days ago.
Improve this question
im trying to make a song player for my project and i encountered a problem where my button doesnt work when clicked, how do i fix this?
heres the coding i followed from a youtube video:https://youtu.be/JtrFzoL1joI 19:01
`<audio controls id="song">
<source src="DOOR S ELEV SONG.mp3" type="audio/mpeg">
</audio>
<br>
<center>
<input type="range" value="0" id="progress"></input>
<br>
<br>
<br>
<div class="controls">
<div><i class="fa-solid fa-backward"></i> </div>
<div onclick="playPause()"><i class="fa-solid fa-play" id="ctrlIcon"></i> </div>
<div><i class="fa-solid fa-forward"></i> </div>
</div>
</div>
</div>
</div>
<script>
let progress = document.getElementById("progress");
let song = document.getElementById("song");
let ctrlIcon = document.getElementById("ctrlIcon");
song.onloadedmetadata =function(){
progress.max=song.duration;
progress.value=song.currentTime;
}
function playPause(){
if(ctrlIcon.classlist.contains("fa-pause")){
song.pause();
ctrlIcon.classlist.remove("fa-pause");
ctrlIcon.classlist.add("fa-play");
}
else{
song.play();
ctrlIcon.classlist.add("fa-pause");
ctrlIcon.classlist.remove("fa-play");
}
}
</script>`

Related

How can I create a sliding size selector with HTML? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
How can I create something similar to the image using only HTML5?
__________
s m l xl
Thank you!
This is simplest solution.
<div>
<input type="range" id="volume" name="volume" min="0" max="3" step="1">
</div>
<div>
<span style="display:inline-block; width:35px">S</span>
<span style="display:inline-block; width:35px">M</span>
<span style="display:inline-block; width:35px">L</span>
<span style="display:inline-block; width:35px">XL</span>
</div>

<a> tag with type button and btn-primary class is not working in MacOS safari [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
Anchor tag with type button and btn-primary class is not working in MacOS safari but same code is working fine in chrome , edge browser
<a class="btn btn-primary " style="border-radius: 25px;" type="button" href="#" <i class="fa fa-download" aria-hidden="true"></i>> Download Client</a>
MACOS safari browser
chrome browser
please suggest me the right way to implement the tag with bootstrap
Remove the type="button" and it should work.
<a class="btn btn-primary" style="border-radius: 25px;" href="#">
<i class="fa fa-download" aria-hidden="true"></i> Download Client
</a>
Happy coding!

bootstrap will not print [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I added bootstrap last minute, before I added it, page printed correctly. Now, it does not. Ive looked at the other answers to this question, but none seemed to directly apply to me.
<div class="row">
<div class="col-md-12">
<h2><span>Palette</span></h2>
</div>
</div>
<div class="row">
<div class="col-sm-2">
<div class="pri-circle circle" data-palette-name="primary" id="color1"></div>
<div>
<form>
<input type="text" placeholder="#" data-picker-for="#color1" class="theme" />
</form>
</div>
</div>
<div class="col-sm-2">
<div class="pd-circle circle" data-palette-name="primary-dark" id="color2"></div>
<div>
<form>
<input type="text" placeholder="#" data-picker-for="#color2" class="theme"/>
</form>
</div>
</div>
</div>
If you added it last minute I suspect you added your bootstrap.css file last minute as well. If you have custom CSS that overrides bootstrap default you need to make sure your costum CSS file parses after bootstrap.css, so make sure your file order in your header is correct.

I have a link that I want to open in a new tab. As it is in a <div> I am unsure how to do this - I am new to php coding [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 8 years ago.
Improve this question
This is the code I currently have, that opens the link in the same page. I want to modify this to make it open in a new tab.
<div class="big-button" ">
<input type="submit" value="Link name" />
</div>
Use target="_blank" in your anchor
Use this :
<div class="big-button" ">
<input type="submit" value="Link name" />
</div>
I think you need this
<a href='URL' target='_blank'>xyz</a>
Give the your url as href attribute and give target attribute as _blank. It will open in new window
<input type="button" value="Click Me!" onclick="window.open('http://google.com')" />
Hint:
target="_blank" is not validate W3C.
Use this code in a tag:
onclick="window.open(this.href); return false;"

Match appearance of buttons [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have two buttons (both working btw..I just need to change the appearance of them to match)
First button opens a print preview page, the second button opens the web browser print dialogue screen. I want to change the second button to match the first.
Is there anyway I can use a HREF on the second button and use an onclick...so it will use the same template for the button instead of fixing this through css?
First Button:
<div style="width:100%; text-align:right">
<a href='#Url.Action("Index", "Route", new { id = Id })'>
<button>Print Preview</button>
</a>
</div>
looks like:
second button:
<div style="width:100%; text-align:right">
<br />
<input type="button" value="Print" onclick="window.print();" />
</div>
looks like:
try this
<div style="width:100%; text-align:right">
<br />
<a onclick="window.print();">
<button>Print</button>
</a>
</div>