JSFiddle - React, Tailwind, and code Playground
by vijayweb
HTML
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<br>
First Name: <input type="text" id="txt1" value="123" /><br />
Last Name: <input type="text" id="txt2" /><br />
Address 1: <input type="text" id="txt3" /><br />
Address 2: <input type="text" id="txt4" /><br />
City: <input type="text" id="txt5" /><br />
State: <input type="text" id="txt6" "/><br /><br />
<br>
<div id="button" class="btn">Get ids of blank text boxes</div><br />
<a href="#">Click to from this site</a>
JavaScript
$(function() {
var string1,strring2;
$('a').click(function() {
var ar1=new Array("txt1","txt2","txt3","txt4","txt5","txt6");
var ar2=new Array("First Name","Last Name ","Address 1","Address 2","City","State");
var emptyTextBoxes = $('input:text').filter(function() {
return this.value != ""; });
emptyTextBoxes.each(function(index) {
string1 = ar1[index] ;
string2 = ar2[index] ;
});
alert(string1);
alert(string2);
});
});