Home > Enterprise >  How to let user pick the color of the selected text like google docs
How to let user pick the color of the selected text like google docs

Time:08-05

I am trying to make a google docs like project, and I am currently on the part of allowing the user to pick a color to make the text. I want to let them select the text inside the input box and then select a color using the buttons. I have made the button to change the text to the color red, but I don't know what to do after that.

Here is the code:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Editor</title>
    <link rel="stylesheet" href="index.css" />
  </head>
  <body>
    <button  onclick="document.execCommand('bold',false,null);">           
  • Related