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 6887595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:54:15+00:00 2026-05-27T05:54:15+00:00

Below is the function that I am using in jquery function addlnkfieldmkAndyr() { var

  • 0

Below is the function that I am using in jquery

function addlnkfieldmkAndyr()
{
    var mymke =  $('h3:contains("Make")');
    var mymkeVal= $('h3:contains("Make")').closest("td").next();

    var myyr=  $('h3:contains("Year")');
    var myyrVal= $('h3:contains("Year")').closest("td").next();
}

The problem that is there is another field with the name as MakeandYear , so mymkeVal and myyrVal are getting the values from MakeandYear instead of just Make.

I would like to say

string.Contains("Make") && !string.Contains("MakeandYear). 

How do I do that in jquery , please help!

  • 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-05-27T05:54:15+00:00Added an answer on May 27, 2026 at 5:54 am

    Andrey pointed to the .not function, which is a perfectly good answer. You can also use the :not selector, in combination with :contains (live example):

    var mymke =  $('h3:contains("Make"):not(:contains("MakeAndYear"))');
    

    The advantage of :not (the selector) over .not (the function) is that you don’t add unnecessary elements to the jQuery object and then remove them. Does it matter? Almost certainly not, and be careful making any performance assumptions, although I think your use of :contains means throwing :not in won’t do any harm. You’d have to have a truly enormous number of h3s for it to matter either way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i have a function that worked fine using jQuery 1.3.2 but now i
how to render a div next to href link, we are using JQuery. Below
using the below jquery placeholder plugin that creates labels and overlays the field with
I'm using the function below that toggles divs, and with it, any one of
I found that using declaring jQuery Autocomplete as the first function in your script
Using jquery I have the function below. When the button is clicked it slides
I am using jquery.form.js (version: 2.84) and in the below code, I see that
When using JQuery, extending an object that has an overridden toString() function causes an
Below is my function that will take a timestamp and tell you the time
I have an example function below that reads in a date as a string

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.