-1

Help me please.... I want to add a background color to PHP echo

My Script:

<div class="container">
    <input name='kursi[]' value='A1' id='A1' onclick='cer(this)' 
    autocomplete='off' type='checkbox' 
    <?php if(in_array(array('no_kursi_order' => 'A1'), $kursi))
      <!-- How to add style background-color here --> 
      {echo "disabled checked";
    } ?>>
    
    <label class='checkmark' for='A1'>A1</label>
</div>
Edwin Nick
  • 39
  • 6

1 Answers1

1

Try this

    <div class="container">
        <input name='kursi[]' value='A1' id='A1' onclick='cer(this)' 
        autocomplete='off' type='checkbox' 
        <?php if(in_array(array('no_kursi_order' => 'A1'), $kursi))
          <!-- How to add style background-color here --> 
-          {echo "disabled checked";
+          {echo "disabled checked style=\"background-color: red;\"";
        } ?>>
        
        <label class='checkmark' for='A1'>A1</label>
    </div>
Kurt Chun
  • 391
  • 4
  • 9
  • @EdwinNick I have revise the issue, it seems like you are trying to change the background of the "input checkbox" in which cannot achieve by normal style only, could check this link https://stackoverflow.com/questions/34388696/how-to-change-the-background-color-on-a-input-checkbox-with-css – Kurt Chun Jul 13 '20 at 07:27
  • this link is correct ... I made it ... but what I want here: "Input checkbox" is clicked yellow after the data is inputted "Input checkbox" is disabled and red. I applied this to "the application chooses seat tickets" Can you help me? – Edwin Nick Jul 13 '20 at 07:41
  • could you provide a screenshot ? – Kurt Chun Jul 13 '20 at 08:17