Very Basic Question – How To Run Sample Javascript from Chrome Browser Console?

Report
Question

Please briefly explain why you feel this question should be reported .

Report
Cancel

Just taking a first nibble at understanding this JavaScript apple!

I\’ve found the sample code included below for how to check for all letters.
No I just want to run it – essentially to test it so I know for sure its good working code.
How do I do that simply with the Chrome>More Tools>Developer Tools – i.e. I clear the console and see \”>\”.  Then what do I do to run this JavaScript?

I told you it was very basic. Yet I’m humbled…
But we all need to start somewhere, right?

Thanks for your help!

function allLetter(inputtxt)
  {
   var letters = /^[A-Za-z]+$/;
   if(inputtxt.value.match(letters))
     {
      return true;
     }
   else
     {
     alert(\"message\");
     return false;
     }
  }
in progress 0
JavaScript 6 months 1 Answer 472 views 0

Answer ( 1 )

  1. ritwik

    Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    Simple paste the code and press enter. If you are typing code in the console, if it is one line code, press ENTER. If it is multiline, press SHIFT+ENTER and write the next line. When you end writing, press ENTER.

Leave an answer

Browse

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>