V
V
Valery Pavlenko2017-09-24 10:38:32
HTML
Valery Pavlenko, 2017-09-24 10:38:32

How to fix the function that generates the output of the document content?

I designed the output of the article's table of contents, as indicated here:
https://dle-faq.ru/faq/phpquest/20523-pomogite-sde... I
fixed the function only by replacing find('h3,h4') with find('h2,h3 ').
The whole code is here: https://jsfiddle.net/u5hz7v92/
Now I have subheadings in the document wrapped in a tag <a>, which is not necessary.
Screenshot of the source code:
68d6fba58b7740bf8caa9c3a172c8d0b.png
How to change the function so that the subheadings in the document do not turn into a link, while the "anchors" from the table of contents work?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lamer350, 2019-06-11
@lamer350

because the submit button must be inside the form (tag <form>), and you most likely create a modal window somewhere at the end of the page.
Hang a handler on jquery

$('button.submit').on('click', function() {
     $('form').submit();
});

A
AUser0, 2019-06-11
@AUser0

The beginning of the form <form ...> is somewhere in non-existence. Perhaps this is the problem.

D
Dmitry, 2017-09-24
@slo_nik

Good afternoon.
You can start with the following code.
The code is not perfect, but the idea, I think, will be clear.
ps The code works for headings, do it yourself for subheadings, by analogy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question