"reverse string with palindrome"
Bootstrap 4.0.0 Snippet by Hituat

<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html> <body> <h1>Reverse String Task</h1> Enter the String : <input id="demo1" type="text" placeholder="give any string"><br><br> <button onclick="myFunction()">click</button><br><br> your Reverse String is : <input id="demo2"type="text" ><br><br> Answer :<span id="check1"></span> <script> function myFunction() { var str =document.getElementById("demo1").value; var arr =""; var y=arr; for(i=str.length-1;i>=0;i--) { arr+=str.charAt(i); } document.getElementById("demo2").value=arr; if(str==arr) { document.getElementById("check1").innerHTML="palindrome"; } else { document.getElementById("check1").innerHTML="not palindrome"; } } </script> </body> </html>

Related: See More


Questions / Comments: