jquery练习4 获取文本框输入
来源:互联网 发布:java 程序运行时间 编辑:程序博客网 时间:2024/06/05 01:51
原文,使用原生js
非常基础的练习
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <meta http-equiv="Content-Type" content="text/html charset=utf-8" /> <script src="http://code.jquery.com/jquery-1.8.3.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#btn1").click(function(){ var sheng =document.getElementsByName("sheng"); var shi=document.getElementsByName("shi"); alert("省:"+$("#sheng").val()); alert("市:"+$("#shi").val()); }); }); </script> <style type="text/css">body{margin: 0 auto;text-align: center;} .wrapper{ width:500px; height:300px; line-height: 30px; margin: 0 auto; text-align: center; } input,button{ margin-top: 50px ; } </style> <title> 获得用户输入的参数 </title></head><body> <div class="wrapper"><input type="text" id ="sheng" placeholder="请输入省名"><br/><input type="text" id="shi" placeholder="请输入市名"><br/><button type="button" id="btn1">确认</button> </div></body></html>
阅读全文
0 0
- jquery练习4 获取文本框输入
- JQuery获取文本框值
- jQuery获取文本框数据
- jquery 文本框只能输入数字
- Jquery 限制文本框输入字数
- 文本框输入字数限制JQuery
- JQuery 输入文本框 简单事件
- js获取文本框输入焦点
- JQuery获取文本框的值
- jquery 获取文本框中的文本
- Jquery 仿新浪微博获取文本框能输入的字数
- jQuery 获取文本框内的输入文字,将其设为value属性的值
- jquery里面获取div区块的宽度与高度 和 文本框中只能输入数字
- 【jquery技巧】jquery获取文本框字符数
- Jquery实现只能输入数字的文本框
- Jquery实现只能输入数字的文本框
- JQuery 实现文本框只能输入数字
- jquery artTxtCount 文本框输入字数提示
- 延迟加载图片插件LazyLoad.js的使用方法
- Mac安装文件时提示“文件已损坏,建议移到废纸篓”的问题
- script元素的位置及defer、async属性
- Vue--moment时间格式插件安装和使用
- 《图解HTTP[上野宣]》读书笔记六-7
- jquery练习4 获取文本框输入
- QT实战
- java protected修饰符访问权限
- iOS UIbutton 点击无反应的几种情况
- 运放中这些常见指标都不了解?赶紧看看吧.....
- EMC设计的四大技巧
- 三百六十行,行行转互联网?
- ORA-29275部分多字节字符
- Linux文件系统的硬链接与软链接