Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
jquery val() contiene()

Quiero saber si el valor del área de texto contiene una determinada palabra. Esto no funciona para mí.

 var value = $('#embedModal textarea').val(); if($(value).contains('iframe')){...
over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Prueba javascript

 if (value.indexOf('iframe') >= 0) {

JQuery contiene es para elementos DOM, no cadenas.

over 4 years ago · Santiago Trujillo Report

0

Intenta hacerlo así:

 $('#embedModal textarea:contains("iframe")').each(function() { //Do something });

editar

Ejemplo

over 4 years ago · Santiago Trujillo Report

0

esto funciona:

 $.contains( document.documentElement, document.body ); // true var babyEl = $('div#id'); var daddyEl = $('div#ID'); if($.contains(babyEl, daddyEl)) { //do fun stuff }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!