JSFiddle - React, Tailwind, and code Playground
HTML
<div class="zpoisk">
<input id="zapros" type="text" class="element-itemname">
<input id="ok" type="button" name="send-clone" value="ОК" class="ok">
</div>
<input class="element-tmpl-hidden" value="">
<input class="element-tmpl-hidden" value="">
<input class="element-tmpl-hidden" value="">
<input class="element-tmpl-hidden" value="">
JavaScript
(function ($) {
$(document).ready(function (zp) {
$("input#ok").bind('click', function () {
inputVal = $("#zapros").val();
if (!inputVal) {
alert("Введите сначала поисковый запрос");
} else {
$("input.element-tmpl-hidden").val(inputVal);
alert("Не пустой");
}
});
});
})(jQuery);