TypeError: stepUp called on an object that does not implement interface HTMLInputElement

前端 未结 3 1443
半阙折子戏
半阙折子戏 2021-01-03 17:50

I have this code

Find/Add Horse

And I do

相关标签:
3条回答
  • 2021-01-03 18:21

    I had similar issue, it was because I forgot to have .val() when trying to access the value of the input element.

     $.post('@Url.Action("Calculate", "AvailableInvestment")',
                {
                    code: $("#calculatorCode").val(),
                    amount: $("#calculatorAmount").val()
                },
                function (data, status) {
                    console.log(data, status);
                    if (data.success == true) {
                         
                    }
    
                    else {  
                         
                        return;
                    }
    
                }
            );
    
    0 讨论(0)
  • 2021-01-03 18:24

    If search_term is an input field you might want to get its value.

    var search_term = $(this).parents('.sub-middle-column').find('.search_horse').val();
    

    Right now you are referencing a jQuery Object containing a HTMLDom-Element but I think what you want is the string inside the search input element.

    0 讨论(0)
  • 2021-01-03 18:39

    TypeError: stepUp called on an object that does not implement interface HTMLInputElement comes when you forget # sign for(id) and . sign for class. when we can get value directly without . or # sign.

    Wrong method: - var email = $('PHMC_email').val();

    Correct Method:

    -var email = $('#PHMC_email').val(); Or var email = $('.PHMC_email').val();

    0 讨论(0)
提交回复
热议问题