Input Text size 属性
定义和用法
size 属性用于设置或返回文本域的 size 属性值。
size 属性设置或返回文本域的尺寸(以字符数计)。
默认值为 20。
提示: 如果要设置或返回 password 字段允许输入的字符数,请使用 maxLength 属性。
浏览器支持
所有主流浏览器都支持 size 属性
语法
返回 size 属性:
textObject.size
设置 size 属性:
textObject.size=number
属性值
值 var kn = {ismenu:'0',pename:'jsref',kename:'prop-text-size',};$(function(){$(".onlinenote").show();var kename = kn.kename;var fid = "-1";var uid = '0';// SyntaxHighlighter.config.clipboardSwf = '/plugins/ueditor/third-party/zeroclipboard/ZeroClipboard.swf';// SyntaxHighlighter.all();//代码高亮/*开启计时 准备记录积分*/var vcreditfull = $.cookie('ypre_vcreditfull');//console.log(vcreditfull);if(vcreditfull == undefined && uid != '0' && uid != ''){setTimeout(function(){$.ajax({url:"/project/setViewCredit",type:"post",data:{kename:kename},dataType:"json",success:function(msg){var statusCode = {'200':'success','400':'warning',};var toastrType = statusCode[msg.statusCode];if(msg.statusCode == 300 || msg.statusCode == 400){return;}toastr[toastrType](msg.message);}});},30000);}hljs.initHighlightingOnLoad();//高亮代码// // 上一篇 下一篇// if(fid == "-1"){// $(".prenext").parent().remove();// }else{var el = $(".dd-item[data-id="+kename+"]");// var prevel = el.prev();// var nextel = el.next(); // var prev = prevel.find('a')[0]; // var next = nextel.find('a')[0];// if(prev == undefined){ // prev = el.parents(".dd-list").prev().find('a')[0]; // } // if(next == undefined){ // next = el.parents(".dd-item").next().find('a')[0]; // }// if(prevel.attr("ismenu") == 1){ // prev = prevel.find // }// if($(prev).length < 1){ // $(".previous-link").hide(); // }else{ // //$(prev).clone().appendTo(".previous-link"); // $(".previous-link >a").attr("href",$(prev).attr("href")).attr("title",$(prev).attr("title")); // $(".previous-link").show();// }// if($(next).length < 1){ // $(".next-link").hide(); // }else{ // $('.next-link > a').attr("href",$(next).attr("href")).attr("title",$(next).attr("title")); // $(".next-link").show(); // }// }//当文章为文件夹的时候 并且内容为空的时候显示文件夹内部文章列表if($(".view-box").html() == "" && kn.ismenu == 1){$(el).clone().appendTo(".view-box");$(".view-box").find(".dd-content").removeClass("folder-open").removeClass("folder-close").css({"background-color":"#fff"});}// $(".dd-content[class*=folder-]").click(function(){// var obj = $(this);// if(obj.hasClass("folder-open")){// obj.removeClass("folder-open");// obj.addClass("folder-close");// obj.next().hide();// }else{// obj.removeClass("folder-close");// obj.addClass("folder-open");// obj.next().show();// }// });});function getviewkn(){var usernamestr ='';$.ajax({url:"/my/knowledge/getViewkn?pename="+kn.pename,dataType:"json",success:function(msg){var objli,objtt;for(var p in msg){objli = $("#nestable_handbook").find(".dd-item[data-id='"+msg[p]['kename']+"']");if(objli.attr("ismenu") != 1){objli.addClass("readed").find("a").attr("title","上次浏览时间:("+msg[p]['lasttime']+")");}}}}); }// 新|旧版预览 切换function newversion(){var isNewVersion = $.cookie("newversion");if(isNewVersion == 1){$.cookie("newversion",0,{path:'/'});}else{$.cookie("newversion",1,{path:'/'});}window.location.reload();}function islike(){$.ajaxdo({url: "/project/islikeKn",type: "post",dataType: 'json',data: {"pename":'jsref',"kename": 'prop-text-size'},sync: false,success: function (data) {if (data.statusCode == 200) {$('.avatar-list').find('p').remove();$('.avatar-list').append('');var likecount = $("#likecount").text() * 1 + 1;$("#likecount").html(likecount);$(".btn-thumbs-up i").attr('class','thumbs-up-icon-isdone');$("#likestatus").html('已赞');toastr.success(data.message,'',{"positionClass": "toast-top-center"});} else {toastr.warning(data.message,'',{"positionClass": "toast-top-center"});}}});}function isstar(){var type = $('#hbstar').attr('data-type');$.ajaxdo({url: "/project/tempStar",type: "post",dataType: 'json',data: {kename:'prop-text-size',pename:'jsref',ktype:'kn',},success: function (data) {if(data.statusCode == 200){if (type == 'star') {$('#hbstar').html('已收藏');$('#hbstar').attr('data-type','rstar');toastr.success(data.message,'',{"positionClass": "toast-top-center"});} else {$('#hbstar').html('收藏');$('#hbstar').attr('data-type','star');toastr.success(data.message,'',{"positionClass": "toast-top-center"});}}else{toastr.warning(data.message,'',{"positionClass": "toast-top-center"});}}});}window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"2","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='//bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)]; |
---|