how a particular area will be focus on page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pramendra12
    New Member
    • Jul 2012
    • 1

    how a particular area will be focus on page

    i want to focus a particular area in html page,when href link click
  • lyodmichael
    New Member
    • Jul 2012
    • 75

    #2
    Code:
    window.onload = function () {
        $("???").focus();
    }
    Last edited by gits; Jul 20 '12, 11:32 AM. Reason: added code tags

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      that shown code would work when there is a defined $-function as it would be the case with using a javascript-framework like jQuery, and the 'area' (aka: element) that should be focused has a focus-method. Further it would be executed onload.

      so the requirement should be a bit more detailed and best would be to give an example - the basics to a solution for this are:

      1. retrieve a reference to the element that should be focused
      2. call a appropriate method to set focus to that element
      3. call that all from the onclick-handler of the link

      Comment

      • lyodmichael
        New Member
        • Jul 2012
        • 75

        #4
        i forget the defined function is a textbox :), sorry

        Comment

        Working...