JSFiddle - React, Tailwind, and code Playground
by Deepak Manwal
HTML
<div id="container">this is my div
<input type="text" value="50" name="first_input">first label</input>
<button>first button</button>
<input type="text">second label</input>
<input type="text">third label</input>
<input type="text">fourth label</input>
<button>second button</button>
<input type="text">fifth label</input>
<button>third button</button>
<input type="text">sixth label</input>
<button>fourth button</button>
<input type="text">seventh label</input>
<button>fifth button</button>
<button>sixth button</button>
<button id="ss">seventh button</button>
<label id="lbl1">hello</label>
</div>
JavaScript
$(document).ready(function () {
$('input:text').eq(0).attr({
title: 'please input the value',
placeholder: 'insert a value',
name: 'input_type',
//value:25
});
$('#ss').click(function () {
alert($('input[type="text"]').get(0).value);
alert($('input[type="text"]').get(0).name);
alert($('input[type="text"]').eq(0).val());
alert($('input[type="text"]').eq(0).val())
});
});