Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

138
Vistas
Define Value range in element using startsWith() - jQuery

I need to know if there is a shorter way to simplify below line of code indicating possible values of an element that starts with a defined 3 digit numbers.

$('#nf-field-168').val().startsWith("010" | "011" | "012" | "013" | "014" | "015");

if there's a way to define them as range (ex. 010 - 015) rather than using the vertical bar Operator? Is such method exist?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try using match() and regex

$('#nf-field-168').val().match(/^01[0-5]/) // returns null if not matched

https://regex101.com/r/F8VnaZ/1

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda