www.webdeveloper.com
Results 1 to 6 of 6

Thread: Please help for a simplest JavaScript function

  1. #1
    Join Date
    Apr 2005
    Posts
    210

    Please help for a simplest JavaScript function

    I read a large php pack, which has a <div> as

    Code:
    <div id="second"	onclick="$('#form').submit();">Second</div>
    I can't find its JavaScript function.

    Please help me to create a simplest JavaScript function (alert is OK) related to code above.

    Thanks.


    .

  2. #2
    Join Date
    Nov 2010
    Posts
    1,083
    submit() is a native javascript method for a form object. It doesn't need a separately written function, so you won't find one.

    you can change the markup to give an alert like this.

    Code:
    <div id="second" onclick="alert('hello')">Second</div>

  3. #3
    Join Date
    Apr 2005
    Posts
    210
    Please do not change my topic.

  4. #4
    Join Date
    Apr 2012
    Posts
    55
    <div id="second" onclick="document.getElementById('form').submit();">Second</div>
    joi JavaScript Framework - the sunnier side of JavaScript.

  5. #5
    Join Date
    Nov 2010
    Posts
    1,083
    Quote Originally Posted by html20009876 View Post
    Please do not change my topic.
    err... I thought I was answering the question.

    What was the question?

  6. #6
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    may be the question was about "$ signed function"? if so, the topic starter has to visit this site jquery.com
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

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