jquery如何让input输入内容显示斜体

在jquery中, 通过css()方法可以设置input的样式, 实现输入框文字为斜体 。 下面小编举例讲解jquery如何让input输入内容显示斜体 。 【jquery如何让input输入内容显示斜体】

jquery如何让input输入内容显示斜体




需要这些哦
台式组装机
windows10
z studio10.0
html+jquery
方式/
1新建一个html文件, 定名为test.html, 用于讲解jquery若何让input输入内容显示斜体 。
jquery如何让input输入内容显示斜体



2在test.html文件中, 建立一个input输入框, 用于测试 。
jquery如何让input输入内容显示斜体



3在test.html文件中, 设置input的id为test 。
jquery如何让input输入内容显示斜体



4在js标签内, 利用ready方式在页面加载完当作时, 执行function函数 。
jquery如何让input输入内容显示斜体



4
5在js标签内, 经由过程id获得input对象, 利用css方式将font-style属性设置为italic, 从而实现斜体文字 。
jquery如何让input输入内容显示斜体



6在浏览器打开test.html文件, 查看成果 。
jquery如何让input输入内容显示斜体



总结:11、建立一个input输入框, 设置input的id为test 。 2、在js标签内, 利用ready方式在页面加载完当作时, 执行function函数 。 3、在js标签内, 经由过程id获得input对象, 利用css方式将font-style属性设置为italic, 从而实现斜体文字 。 4、在浏览器打开test.html文件, 查看成果 。


以上内容就是jquery如何让input输入内容显示斜体的内容啦, 希望对你有所帮助哦!

    猜你喜欢