Javascript for calling text

In the template of my website, through javascript in each page i am calling an image everytime that plays the role of the logo on its page.
I want this now to be text and not image anymore.
Any ideas?

Current javascript:
$(document).ready(function() {
// Hero main image
$(‘#hero-img’).attr(‘src’, ‘/pageassets/shops/engineroom/barsshopslogo.png’);

Example page: (The image title that says Bars & Shops)

$('#hero-text').text('booyah, free beer!');

didnt work :frowning:

if you don’t have that ID or the referenced element is an empty one, I would have expected as much.

I’m not seeing it.

<div class="row hero">
        <div class="container">
            <div class="row">
                <div class="col-md-12 text-center">
                    <img id="hero-img" src="/pageassets/shops/engineroom/barsshopslogo.png" class="img-responsive">

images are not known for accepting text. some changes in intent require a change in code. and since the TO didn’t know how to add text to an element–e.g. a paragraph–I was giving an example.

lol I meant I didn’t see anything with an id of hero-text.

If the DOM can’t be modified (and seeing that “col-md-12” stuff would make me hesitate and tread carefully) I think it should be possible to do a type of parentNode child swap out.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.