Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Split Javascript

Pembahasan hari ini adalah mengenai bagaimana memotong kata/kalimat dalam javascript



Oke sekarang langsung ke script aja :


  <!DOCTYPE html>
  <html>
  <body>
  <p>Click the button to display the array values after the split.

<button onclick="myFunction()">Try it <p id="demo">

<script> function myFunction() { var str = "How are you doing today?"; var res = str.split(" "); document.getElementById("demo").innerHTML = res[0]; } </script> </body> </html>
[Read more]