Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Usando Jquery
- $("form input").each(function(){
- var id = $(this).attr('id');
- var attr = $("#" + id).attr("type");
- var ranS = Math.random().toString(36).substring(3);
- if(attr=="text" || attr=="password"){
- $(this).val(ranS);
- }else if (attr=="email") {
- $(this).val(ranS + "@ian.com");
- }else if (attr=="number") {
- $(this).val(Math.floor(Math.random() * (100000000 + 999999999)));
- }else if (attr=="checkbox") {
- $(this).attr("checked",true);
- }else{
- alert("Incluir el type: " + attr + " en la lista");
- }
- });
- $("form select").each(function(){
- var id = $(this).attr('id');
- console.log(id);
- $(("#" + id)).append('<option selected value="1">Cristtian</option>');
- });
Add Comment
Please, Sign In to add comment