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

144
Views
Put in html tag value from javascript

I need to wrap r.title value with <b></b> tag. I wanted to do so r.subtitle && (l = "<b>" + r.title + "</b>" + r.subtitle), but displays it in text.

This function

function (e, t, n) {
        "use strict";
        function r(e) {
            return e && e.__esModule ? e : { default: e };
        }
        Object.defineProperty(t, "__esModule", { value: !0 });
        var o = n(0),
            a = r(o),
            i = n(1),
            l = r(i),
            u = function (e) {
                var t = e.className,
                    n = e.style,
                    r = e.track,
                    o = e.trackNo,
                    i = e.displayArtistNames,
                    l = r.title;
                return i && r.subtitle && (l = r.title + " - " + r.subtitle), null != o && (l = o + ". " + l), a.default.createElement("span", { style: n }, l);
            };
        (u.propTypes = { track: l.default.object.isRequired, trackNo: l.default.number, style: l.default.object, className: l.default.string, displayArtistNames: l.default.bool }), (t.default = u);
},
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the .innerText property to set element's text or .innerHTML / .outerHTML to set the html-code inside or outside of html element tag:

var elementCode = "<b>" + title + "</b>";
document.body.innerHTML += elementCode;

You can also use create and append child functions (more recommended)

about 4 years ago · Juan Pablo Isaza 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!