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

203
Vistas
Making variable text bold
  var text1 = "Mind";
  var text2 = document.getElementById("t1").value;
  var text3 = text1.concat(text2);
  document.getElementById("t2").innerHTML = text3;

I want to make the text of variable "text2" in bold when displayed, Please tell how I can do that...

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

0

text2.style.fontWeight = 'bold';

about 4 years ago · Juan Pablo Isaza Denunciar

0

Here you do not need any css. Bold function Create a tag .

var text1 = "Mind";
var text2 = document.getElementById("t1").value.bold();
var text3 = text1.concat(text2);
document.getElementById("t2").innerHTML = text3;

Or You can do this

var text1 = "Mind";
var text2 = document.getElementById("t1").value;
document.getElementById("t1").style.fontWeight = "900";
var text3 = text1.concat(text2);
document.getElementById("t2").innerHTML = text3;
about 4 years ago · Juan Pablo Isaza Denunciar

0

In two ways

1.add its style like this:

text2.style.fontWeight = 'bold';
  1. you can do it setting the innerHTML property of the element, just like this:

     text2.innerHTML = "<b>Hello</b>";
    
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