代码如下You could use either $('input[type=text]') or $('input:text')$("input[name^='Text1']").each( function() { $(this).rules("add", { required: true, messages: { required: "也是必填"} }); } )