How to make text bold,italic and underline using jquery

前端 未结 3 1110
傲寒
傲寒 2021-02-04 07:24

I have three checkboxes and a textbox now If I write something in textbox and check the bold checkbox the text should appear with bold effect and similarly italic and underline

3条回答
  •  不知归路
    2021-02-04 08:18

    You can do that using simple CSS and a little jQuery code.

    1.First define your cascading style sheet classes

    
    

    2.Load jQuery

    
    

    3.Write the function for switching the classes

    
    

    5.Modified html

    Bold:
    Italic:
    Underline:
    

    jsfiddle link: http://jsfiddle.net/deepumohanp/t2wKP/

提交回复
热议问题