$(document).ready(function() {
$("button").click(function(e) {
e.stopPropagation();
console.log("only button is clicked");
$("input:text").val("Test");
});
$("body").click(function() {
console.log("body clicked");
$("input:text").val(''); // add this line to remove the text
});
})