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

    Join Date
    Jan 2016
    Posts
    21
    Rep Power
    0

    jQuery $.get() return specifc selector from page to Input field


    Hi

    Using the jQuery $.get() function, is it possible to return a particular ID from the page that is queried.

    I have the following code working using .load, but as I am wanting to return the value to an input field I believe I need to use $.get(). But all I get is all my HTML returned in to the value of the input field.

    Code:
     $("button").click(function(){
            $('#part_number').load('AJAX.asp?pn=' + $('#qpn').val() + ' #pn);
        });
  2. #2
  3. Impoverished Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,885
    Rep Power
    9646
    It's your own AJAX.asp, right? Wouldn't it be easier to modify that so it returns what you want?

    In Javascript you'd have to load the HTML into a Document, then locate the information using whatever methods are most appropriate (which depends on the HTML).

IMN logo majestic logo threadwatch logo seochat tools logo