Hi,
module namespace jq = "http://www.architextus.com/xquery/library/how2_jquery";
declare namespace rest="http://exquery.org/ns/restxq";
declare %rest:path("/testjquery")
%rest:GET
function jq:test() as node(){
let $html := <html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Testing JQuery</title>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
</head>
<body>
<div>
<p><input id="helpful-yes4" name="helpful" type="radio"></input><span>Yes</span>
<input id="helpful-no4" name="helpful" type="radio"></input><span>No</span></p>
<p>Here is a paragraph</p>
<div id="t1">Test redirectire.</div>
<script type="text/javascript">
$("#helpful-no4").click(function ( event ) {
$("#t1").show();});
$("#helpful-yes4").click(function ( event ) {
$("#t1").hide();});
</script>
</div>
</body>
</html>
return $html
};