Javascript特效:输入框焦点判断
发布日期:2021-06-30 15:43:51 浏览次数:2 分类:技术文章

本文共 444 字,大约阅读时间需要 1 分钟。

知识点

  1. 两种添加事件的语法区别:事件名称是不一样的
    input.onfocus = function (ev1) {
    this.style.width = '600px'; this.style.height = '200px'; this.style.outline = 'none'; this.style.fontSize = '50px';};input.addEventListener('focus',function (evt) {
    this.style.width = '600px'; this.style.height = '200px'; this.style.outline = 'none'; this.style.fontSize = '50px';});

效果

初始效果

在这里插入图片描述
点击输入框,获得焦点
在这里插入图片描述
点击输入框外部,失去焦点

在这里插入图片描述

代码

    
Title
姓名

转载地址:https://kaisarh.blog.csdn.net/article/details/103644940 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Javascript特效:上传图片格式判断(通过后缀)
下一篇:Javascript特效:表单选中、取消选中、反选

发表评论

最新留言

很好
[***.229.124.182]2024年04月14日 05时16分19秒