JSFiddle - React, Tailwind, and code Playground
by Hifni Nazeer
HTML
<input type="text" id="txtUsername" placeholder="enter text"/>
<input type="text" id="txtPassword" placeholder="enter text"/>
<div id="div0">
</div>
<p id="div1">
<a href="#">Hello</a>
</p>
<button>
click
</button>
JavaScript
$(function() {
$('input').focusout(function() {
var val = $(this).val();
var id = $(this).attr('id');
console.log(val);
console.log(id);
var str = `Focus out on ${id} for Value ${val}`;
$('#div0').append('<p>'+ str + '</<p>');
});
$('button').click(function(){
var v = $('p').text;
//var html = $.parseHTML(v);
//alert(html);
var v1 = $('a', v);
alert(v1);
});
});