Skip to content
Advertisement

How to create read more arrow with javascript?

I have a PSD like this.

psd1

When I click on this arrow down, It must show more info like this.

psd2

But no matter how hard I try, it’s not right

JavaScript
JavaScript
JavaScript

Advertisement

Answer

Update your html markup, nested wrongly some block elements inside inline elements.

Your html markup also is missing id attribute of several elements, so your js will throw errors.

Since your PSD nor your html is showing any actual dots, you could probably remove this part from your script, since it has no specific use.

JavaScript
JavaScript
JavaScript

An example with dots and multiple paragraphs using classes instead of ids:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement