input

jQuery DOM操作

时光毁灭记忆、已成空白 提交于 2020-03-18 05:23:32
jQuery DOM操作 标签属性操作 attr() //getAttrbute() setAttrbute() 路径的相对地址 removeAttr() //removeAttibute() <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <img src="./xiaohua.jpg" alt="" > <script src="./libs/jquery-3.3.1.js"></script> <script> $(function () { //attr //获取值 console.log($('img').attr('src')); //./xiaohua.jpg //设置值 $('img').attr('alt','美女'); //./xiaohua.jpg //设置多个标签属性值 $('img').attr({ 'aaa':'美女', 'bbbb':'个哈哈哈' }); //移除 removeAttr() setTimeout(()=>{ //移除单个属性 // $('img').removeAttr('alt'); //移除多个属性 $('img').removeAttr('alt aaa bbbb'); },3000

Passing react text field input values as parameters to a method

痞子三分冷 提交于 2020-03-18 04:07:37
问题 I have the below input fields of which I need to get the entered inputs and pass it to the onClick event of the button shown below. <input type="text" style={textFieldStyle} name="topicBox" placeholder="Enter topic here..."/> <input type="text" style = {textFieldStyle} name="payloadBox" placeholder="Enter payload here..."/> <button value="Send" style={ buttonStyle } onClick={this.publish.bind(this,<value of input field 1>,<value of input field2>)}>Publish</button><span/> I have a method

Passing react text field input values as parameters to a method

主宰稳场 提交于 2020-03-18 04:06:08
问题 I have the below input fields of which I need to get the entered inputs and pass it to the onClick event of the button shown below. <input type="text" style={textFieldStyle} name="topicBox" placeholder="Enter topic here..."/> <input type="text" style = {textFieldStyle} name="payloadBox" placeholder="Enter payload here..."/> <button value="Send" style={ buttonStyle } onClick={this.publish.bind(this,<value of input field 1>,<value of input field2>)}>Publish</button><span/> I have a method

jquery学习笔记

断了今生、忘了曾经 提交于 2020-03-18 01:48:15
偶尔翻出以前学习jquery框架做的一些笔记,大体是当时觉得有必要留心的一些东西,怕一不留心删了又错过了,就贴在这里,做个纪念。 1、冒号(:)表示过滤,空格表示所有下级,(>)表示下一级(只一级),(+)表示紧接一个元素,(~)表示同辈,中括号[]表示属性过滤,(,)逗号表示将每一个选择器匹配到的元素合并后一起返回 2、注意css和attr的区别,css是样式,attr是属性。例如:图片的src、alt都是属性,但非样式。 3、若名称是由两个单词合并的第二个单词的首字母大写。例如:nextAll/wrapInner/prevUntil/andSelf等。 4 、$("button").click();错误,button是input里面的一个属性,可以这样选择input里type属性为button的元素--$("input[type='button']").click(); 5、查找特殊字符的元素,要用// 例如$("#id//-hou") -- <p id="id-hou"></p> 6、如果属性名包含 "-"的话,必须使用引号 7、$("input[name='newsletter']").attr("checked", true);添加属性,checked--true不是(checked,checked) 8、$("input[id][name$='man']") 复合条件

3.17作业

会有一股神秘感。 提交于 2020-03-17 20:42:47
1、编写文件修改功能,调用函数时,传入三个参数(修改的文件路径,要修改的内容,修改后的内容)既可完成文件的修改 import os def file(src_fiule, old_content, new_content): with open(r'{}'.format(src_fiule), 'rb') as rf,\ open(r'{}.swap'.format(src_fiule), 'wb') as wf: while True: res = rf.readline().decode('utf-8') if old_content in res: data = res.replace('{}'.format(old_content), '{}'.format(new_content)) wf.write(bytes('{}'.format(data), encoding='utf-8')) else: wf.write(bytes('{}'.format(res), encoding='utf-8')) if len(res) == 0: break os.remove(r'{}'.format(src_fiule)) os.rename('{}.swap'.format(src_fiule), '{}'.format(src_fiule)) return '修改成功'

day13作业

大城市里の小女人 提交于 2020-03-17 20:34:51
# 1、编写文件修改功能,调用函数时,传入三个参数(修改的文件路径,要修改的内容,修改后的内容)既可完成文件的修改 import os def file(src_fiule, old_content, new_content): with open(r'{}'.format(src_fiule), 'rb') as rf,\ open(r'{}.swap'.format(src_fiule), 'wb') as wf: while True: res = rf.readline().decode('utf-8') if old_content in res: data = res.replace('{}'.format(old_content), '{}'.format(new_content)) wf.write(bytes('{}'.format(data), encoding='utf-8')) else: wf.write(bytes('{}'.format(res), encoding='utf-8')) if len(res) == 0: break os.remove(r'{}'.format(src_fiule)) os.rename('{}.swap'.format(src_fiule), '{}'.format(src_fiule)) return '修改成功'

3-17作业

雨燕双飞 提交于 2020-03-17 20:34:12
1、编写文件修改功能,调用函数时,传入三个参数(修改的文件路径,要修改的内容,修改后的内容)既可完成文件的修改 import os def file(src_fiule, old_content, new_content): with open(r'{}'.format(src_fiule), 'rb') as rf,\ open(r'{}.swap'.format(src_fiule), 'wb') as wf: while True: res = rf.readline().decode('utf-8') if old_content in res: data = res.replace('{}'.format(old_content), '{}'.format(new_content)) wf.write(bytes('{}'.format(data), encoding='utf-8')) else: wf.write(bytes('{}'.format(res), encoding='utf-8')) if len(res) == 0: break os.remove(r'{}'.format(src_fiule)) os.rename('{}.swap'.format(src_fiule), '{}'.format(src_fiule)) return '修改成功'

PHP 表单验证

笑着哭i 提交于 2020-03-17 12:22:03
某厂面试归来,发现自己落伍了!>>> 1.通过PHP来验证表单数据 <!DOCTYPE HTML> <html> <head> </head> <body> <?php // define variables and set to empty values $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = test_input($_POST["name"]); $email = test_input($_POST["email"]); $website = test_input($_POST["website"]); $comment = test_input($_POST["comment"]); $gender = test_input($_POST["gender"]); } function test_input($data) { $data = trim($data);//( PHP trim() 函数)去除用户输入数据中不必要的字符(多余的空格、制表符、换行) $data = stripslashes($data);//(PHP stripslashes() 函数)删除用户输入数据中的反斜杠(\) $data =

用Yeoman构建AngularJS项目

一世执手 提交于 2020-03-17 11:59:12
转至https://yq.aliyun.com/articles/25578 Yeoman 介绍 Yeoman 是 Google 的团队和外部贡献者团队合作开发的,他的目标是通过 Grunt(一个用于开发任务自动化的命令行工具)和 Bower(一个HTML、CSS、Javascript 和图片等前端资源的包管理器)的包装为开发者创建一个易用的工作流。 Yeoman 的目的不仅是要为新项目建立工作流,同时还是为了解决前端开发所面临的诸多严重问题,例如零散的依赖关系。 Yeoman 主要有三部分组成: yo (脚手架工具)、 grunt (构建工具)、 bower (包管理器)。这三个工具是分别独立开发的,但是需要配合使用,来实现我们高效的工作流模式。 Yo 搭建新应用的脚手架,编写你的 Grunt 配置并且安装你有可能在构建中需要的相关的 Grunt 任务。 Grunt 被用来构建,预览以及测试你的项目,感谢来自那些由 Yeoman 团队和 runt-contrib 所管理的任务的帮助。 Bower 被用来进行依赖管理,所以你不再需要手动的下载和管理你的脚本了。 下面这幅图很形象的表明了他们三者之间的协作关系。 Yeoman 特性: 快速创建骨架应用程序 。使用可自定义的模板(例如:HTML5、Boilerplate、Twitter Bootstrap 等)、AMD(通过

css表单常用属性

杀马特。学长 韩版系。学妹 提交于 2020-03-17 09:22:52
<!-- form定义一个表单区域,action属性定义表单数据提交的地址,method属性定义提交的方式。 --> <form action="http://www..." method="get"> <!-- label标签定义表单控件的文字标注,input类型为text定义了 一个单行文本输入框 --> <p> <label>姓名:</label><input type="text" name="username" /> </p> <!-- input类型为password定义了一个密码输入框 --> <p> <label>密码:</label><input type="password" name="password" /> </p> <!-- input类型为radio定义了单选框 --> <p> <label>性别:</label> <input type="radio" name="gender" value="0" /> 男 <input type="radio" name="gender" value="1" /> 女 </p> <!-- input类型为checkbox定义了单选框 --> <p> <label>爱好:</label> <input type="checkbox" name="like" value="sing" /> 唱歌 <input