Using backgroundColor on a button

Where do I place: backgroundColor to get this visiual effect?

@ronpat showed me this before I think and I forgot how to do it using this code.

This is the effect, I forgot how to re-produce it.

I forget where to placeit: It’s not working.
playButton.style.backgroundColor = 'red';

<button id="playButton" style="display:block;width: 266px;height:24px;border-radius:50px;background-image: linear-gradient(  to right,  #000000 83px,#0059dd 83px, #0059dd 86px,  #000000 86px,  #000000 174px, #0059dd 174px, #0059dd 177px,  #000000 177px  );border: 3px solid #0059dd; cursor: pointer;"
onclick="  
var button = document.getElementById('playButton');
  var player = document.getElementById('player');
player.volume=1.0;
  if (player.paused) {
    playButton.innerHTML = '';
    playButton.style.background = 'linear-gradient(  to right,  #0ff 83px,#0059dd 83px, #0059dd 86px,  #fff 86px,  #fff 174px, #0059dd 174px, #0059dd 177px,  #f0f 177px  )';
    player.play();
  } else {
    playButton.innerHTML = '';
    playButton.style.background = 'linear-gradient(  to right,  #000000 83px,#0059dd 83px, #0059dd 86px,  #000000 86px,  #000000 174px, #0059dd 174px, #0059dd 177px,  #000000 177px  )';
    player.pause();
  }">
</button>

<audio id="player" style="display:none;">
  <source src='' type='audio/mpeg' />
</audio>

So you have already been given this information and it exist within these forums.

Usually when I have forgotten information that I have previously been given here I will do a search of my topic to retrieve those answers.
However, in your case I understand that could be quite difficult due to unfeasibly large number of topics that you create here on any one, or related subject, then the problem is multiplied by the huge number of posts that your topics tend to accumulate.
Under these exceptional circumstances where there is such a huge number of topics and posts, many of which relate to the exact same problem, I understand how difficult it must be for you to find and retrieve information that people have given their time to offer you.
However I would question your method of remedying the difficulty. You seem to think that the answer to too many post about the same thing is to create even more topics and posts about the same thing, and thus the confusion increases…

At least try a search.

4 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.