dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: lacking code...need idea.!!!

  1. #1
    Join Date
    Feb 2014
    Posts
    6

    lacking code...need idea.!!!

    1.jpg


    <html>

    <input type="button" value="Click to twist the word"onClick="me()">


    <input type="text" id="word">
    <div id="dota">
    </div>


    <script>

    function random(){
    return (Math.round(Math.random())-0.5); }

    function me() {

    var inputStr = document.getElementById("word").value;
    var inputArr = inputStr.split('')
    inputArr.sort(random);
    var outputStr = "";

    for (var i=0; i<inputArr.length; i++){
    outputStr += inputArr[i]; }

    document.getElementById("dota").innerHTML= outputStr;
    }

    </script>

    </html>

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    6,140
    pls be kind and explain your issue, any errors you have seen etc. It is rather rude to let the volunteers to figure out what your code is doing and what you expect it to do.
    Please elaborate on your issue.
    Cheers

    Khalid

    Message Posting Guidelines In These Forums, Please read these before posting any question.
    Web site: webapplikations.com
    Web Resources Page:Web Resources

  3. #3
    Join Date
    Feb 2014
    Posts
    6

    pic.attach

    view the pic. that i attach... thats what i mean the lacking code

  4. #4
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,868
    1. Please use the appropriate code tags and wrap code elements in them, it makes life easier.
    2. Please state the problem and write the problem as text, not as an image, it makes life easier
    STOP using $ prefix on JavaScript variable names...
    Please remember to wrap any code you have in forum tags:-

    [CODE]...[/CODE] [HTML]...[/HTML] [PHP]...[/PHP]

    If you can't think outside the box, you will be trapped forever with no escape...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles