/    Sign up×
Community /Pin to ProfileBookmark

html replacement from body

not sure if this is possible but lets find out

with out changing anything in the head

i would like to change the html inside the span

<head>
cant touch anything in here
</head>
<body>
<span class=”changeme”>
<input blah blah blah blah>
<input blah blah blah blah>
</span>

!!!! insert code here !!!!!!

</body>

removing the input tags completely and inserting <b>sorry disabled</b> instead

thanks

to post a comment
Full-stack Developer

4 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guyJan 10.2006 — I guess you are wanting this to be an immediate thing that happens on the page without the page reloading, in which case you will need to use javascript.

You could do this:&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;span id="changeme"&gt;
&lt;input blah blah blah blah&gt;
&lt;input blah blah blah blah&gt;
&lt;/span&gt;

&lt;a href="#" onClick="document.getElementById('changeme').innerHTML = '&lt;p&gt;sorry disabled&lt;/p&gt;';return false;"&gt;disable&lt;/a&gt;
&lt;/body&gt;
&lt;/html&gt;
Copy linkTweet thisAlerts:
@ohgodimlameauthorJan 10.2006 — thanks for the quick reply but there are a few things that i cant have with that example

  • 1. i cant change the class to an id

  • 2. i want it to load with the page

  • 3. i want it to be invisible


  • the idea is to disable the inputs on the page so people will not click on them and it looks clean and unnoticable

    i was using this

    [CODE]<style type="text/css">
    .changeme input {display: none;}
    </style>[/CODE]


    but i want to put something in its place

    edit:

    actually since the input fields are like this

    [CODE]<input name="Rating" type="radio" value="1" onclick="javascript:form.submit();">
    <input name="Rating" type="radio" value="2" onclick="javascript:form.submit();">[/CODE]


    changing all the values to 0 would be extremely helpful
    Copy linkTweet thisAlerts:
    @CharlesJan 10.2006 — &lt;script type="text/javascript"&gt;
    if (document.getElementsByTagName) {
    e, i = 0
    while (e = document.getElementsByTagName ('BODY')[0].getElementsBytagName ('*')[i++]) {if e.className.toLowerCase() == 'changeme') e.style.display = 'none'}
    }
    &lt;/script&gt;
    Copy linkTweet thisAlerts:
    @ohgodimlameauthorJan 10.2006 — i just realized that i used the same class later on in the page so i am going to have to do it to make the values of the inputs change instead of changing the html inside of the span

    sorry

    COULD SOME ONE LOCK THIS IM GOING TO START A NEW THREAD WITH A BETTER TITLE
    ×

    Success!

    Help @ohgodimlame spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.19,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...