1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2014
    Rep Power

    Accepting both lower and upper case

    I have this code but I need to be able to input either lower case or upper case and get a result. For example I want to enter history and get back History Book and also enter HISTORY and get back History Book. I

    Can someone help.

    Here is my code.
    <script type="text/javascript">
    function show_prompt()

    var book=prompt("Enter a book");

    if(book == "history" ){
    document.write("<b>History Book</b>");
    }else if( book == "maths" ){
    document.write("<b>Maths Book</b>");
    }else if( book == "economics" ){
    document.write("<b>Economics Book</b>");
    document.write("<b>Unknown Book</b>");



    <input type="button" onclick="show_prompt()" value="click here to find out the book you need" />
  2. #2
  3. Java Junkie
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Feb 2004
    Mobile, Alabama
    Rep Power
    you need to ask this in the javascript forum

IMN logo majestic logo threadwatch logo seochat tools logo