Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #35433 > unrolled thread

HTML appearing on click

Started bybit-naughty@hotmail.com
First post2018-07-24 09:01 -0700
Last post2018-07-25 20:23 +0200
Articles 7 — 4 participants

Back to article view | Back to comp.lang.javascript


Contents

  HTML appearing on click bit-naughty@hotmail.com - 2018-07-24 09:01 -0700
    Re: HTML appearing on click Luuk <luuk@invalid.lan> - 2018-07-24 18:58 +0200
      Re: HTML appearing on click "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-07-24 23:54 +0200
        Re: HTML appearing on click bit-naughty@hotmail.com - 2018-07-24 23:34 -0700
          Re: HTML appearing on click "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-07-25 09:05 +0200
          Re: HTML appearing on click Luuk <luuk@invalid.lan> - 2018-07-25 19:13 +0200
          Re: HTML appearing on click Maik Koenig <usenetspam@maikkoenig.de> - 2018-07-25 20:23 +0200

#35433 — HTML appearing on click

Frombit-naughty@hotmail.com
Date2018-07-24 09:01 -0700
SubjectHTML appearing on click
Message-ID<ed695d9d-f3cb-41f6-8155-f512f3c00fd6@googlegroups.com>
Suppose I have a button, which upon clicking, I want say, a form (or some other HTML) to appear. Now this form could be fairly lengthy. Is the only way to do it, to make the HTML in a separate file, then cut and paste it into the site's code, and put a "var h = " before it, and then innerHTML or appendChild "h" where I want? I imagine whatever escaping is necessary in the HTML itself, after the "var h = ", would be a nightmare?
Or is there some better way to do it?

[toc] | [next] | [standalone]


#35434

FromLuuk <luuk@invalid.lan>
Date2018-07-24 18:58 +0200
Message-ID<5b575aa4$0$2944$e4fe514c@news.xs4all.nl>
In reply to#35433
On 24-7-2018 18:01, bit-naughty@hotmail.com wrote:
> Suppose I have a button, which upon clicking, I want say, a form (or some other HTML) to appear. Now this form could be fairly lengthy. Is the only way to do it, to make the HTML in a separate file, then cut and paste it into the site's code, and put a "var h = " before it, and then innerHTML or appendChild "h" where I want? I imagine whatever escaping is necessary in the HTML itself, after the "var h = ", would be a nightmare?
> Or is there some better way to do it?
> 

surround the stuff with:
<span></span>, or  <div</div> with the apropriate tage to make it
default not visible.

Make it visiable afte the click.

There are people who know more about javascript than i do, so i let them
tell you if you need a SPAN or a DIV to do that ;)

[toc] | [prev] | [next] | [standalone]


#35435

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2018-07-24 23:54 +0200
Message-ID<XnsA929F3276C6E6eejj99@194.109.6.166>
In reply to#35434
Luuk <luuk@invalid.lan> wrote on 24 Jul 2018 in comp.lang.javascript:

> On 24-7-2018 18:01, bit-naughty@hotmail.com wrote:
>> Suppose I have a button, which upon clicking, I want say, a form (or
>> some other HTML) to appear. Now this form could be fairly lengthy. Is
>> the only way to do it, to make the HTML in a separate file, then cut
>> and paste it into the site's code, and put a "var h = " before it, and
>> then innerHTML or appendChild "h" where I want? I imagine whatever
>> escaping is necessary in the HTML itself, after the "var h = ", would
>> be a nightmare? Or is there some better way to do it?
>> 
> 
> surround the stuff with:
> <span></span>, or  <div</div> with the apropriate tage to make it
> default not visible.
> 
> Make it visiable afte the click.
> 
> There are people who know more about javascript than i do, so i let them
> tell you if you need a SPAN or a DIV to do that ;)

<style>
myPart {display:block;border:2px black dotted;padding:8px;width:200px;}
myPart.noDisp {display:none};
</style>

<button 
onclick='document.querySelector("myPart").className="noDisp"'>
Do not display</button>
<br><br>

<button 
onclick='document.querySelector("myPart").className=""'>
Do display</button>
<br><br>

<myPart>
... lots of content ....<br>
... lots of content ....<br>
... lots of content ....<br>
... lots of content ....<br>
</myPart>



-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#35436

Frombit-naughty@hotmail.com
Date2018-07-24 23:34 -0700
Message-ID<2334c16b-90db-4777-a2d1-f15a612c1776@googlegroups.com>
In reply to#35435
Evertjan, thanks, but what's "myPart" - is that a new HTML tag or something, LOL? :) I assume you mean that there will be a DIV or something, where you say "myPart"?

[toc] | [prev] | [next] | [standalone]


#35437

From"Evertjan." <exxjxw.hannivoort@inter.nl.net>
Date2018-07-25 09:05 +0200
Message-ID<XnsA92A5C84FEE22eejj99@194.109.6.166>
In reply to#35436
bit-naughty@hotmail.com wrote on 25 Jul 2018 in comp.lang.javascript:

> Evertjan, thanks, but what's "myPart" - is that a new HTML tag or
> something, LOL? :) I assume you mean that there will be a DIV or
> something, where you say "myPart"? 

This is Usenet, NOT email, 
if you want to respond to something,
please quote relevant part.

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

[toc] | [prev] | [next] | [standalone]


#35438

FromLuuk <luuk@invalid.lan>
Date2018-07-25 19:13 +0200
Message-ID<5b58af9a$0$2970$e4fe514c@news.xs4all.nl>
In reply to#35436
On 25-7-2018 08:34, bit-naughty@hotmail.com wrote:
> Evertjan, thanks, but what's "myPart" - is that a new HTML tag or something, LOL? :) I assume you mean that there will be a DIV or something, where you say "myPart"?
> 

Try, just TRY the solution that Evert gave, and only after TRYing, ask
good questions....

[toc] | [prev] | [next] | [standalone]


#35439

FromMaik Koenig <usenetspam@maikkoenig.de>
Date2018-07-25 20:23 +0200
Message-ID<pjam89.964.1@mid.maikkoenig.de>
In reply to#35436
Am 25.07.2018 um 08:34 schrieb bit-naughty@hotmail.com:
> Evertjan, thanks, but what's "myPart" - is that a new HTML tag or
> something, LOL? :) I assume you mean that there will be a DIV or
> something, where you say "myPart"?
> 
https://www.netmeister.org/news/learn2quote.html

Greetz,
MK
-- 
Kopp-Verlag-Gläubige, Religionsdeppen, rechte Vollidioten
 und ähnlicher Bio-Abfall werden ohne Hinweis ignoriert!
            - Sei eine Möwe: Scheiss drauf -

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web