Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8707597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:54:34+00:00 2026-06-13T03:54:34+00:00

my HTML: <form> <input type=text name=url maxlength=10 /> </form> my JS: $(document).ready(function(){ var inputUrl

  • 0

my HTML:

<form>
    <input type="text" name="url" maxlength="10" />
</form>

my JS:

$(document).ready(function(){
    var inputUrl =  $('input[name=url]');
    inputUrl.change(function() {
        alert(inputUrl);
        if ($(inputUrl).contains('watch'))
        {
            alert ('Contains watch: yes');
        }
        else
        {
            alert ('Contains watch: no');
        }
    });
});

Chrome Console shows:

Uncaught TypeError: Object [object Object] has no method 'contains'

What’s the correct syntax for:

if ($(inputUrl).contains('watch'))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:54:35+00:00Added an answer on June 13, 2026 at 3:54 am
    if (inputUrl.val().indexOf('watch') > -1) {
    

    Or perhaps you only want to operate on the current one that received the event.

    if ($(this).val().indexOf('watch') > -1) {
    

    Or make it case insensitive:

    if (/watch/i.test($(this).val())) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code so far: The HTML: <form> <label>First Name</label> <input type=text class=first
I have a html form <form action=process.php method=post> <input type=checkbox name=name[v1] /> <input type=checkbox
<script type=text/javascript> $('.Ok').live('click', function () { $(#popUp).dialog(close); $('#mydiv').html(); $.ajax({ url: /HRBankInfo/_Partial, type: Get, datatype:
HTML has an input button type to reset all fields in a form to
I've got a html-form with roughly ~1500 input fields* (either text or hidden). The
$('#submit').click(function () { //Get the data from all the fields var name = $('input[name=name]');
I've got a form: <form action=# method=post id=hubForm> <label class=labelText>Expiration Date:</label> <input class=datBox type=text
User inserts a string in a html form input on browser. This string is
My input tag started to go crazy... I have html form for input to
ASP.NET MVC seems to correctly automatically bind between HTML form's file input field and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.