What's new

Welcome to the forum 👋, Visitor

To access the forum content and all our services, you must register or log in to the forum. Becoming a member of the forum is completely free.

Adding a stored Text file and call it within <ul id

Dom

New member
Joined
Feb 14, 2020
Messages
1
Reaction score
0
HTML Coins
0
Hi everyone,
Been doing this on my own up till now and I am stuck. Hopefully this can be done.

I have a list of over 1000 text line Ex: "Party 1, Party 2..." all on different lines on one html page.

Code:
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for title..">

<ul id="myUL">
<li class="invalid nav-item"><a href="Party 1.html">Party 1</a></li>
<li class="invalid nav-item"><a href="Party 2.html">Party 2</a></li>
...
...
</ul>

The text will have 10 more each weeks which makes it time consuming when I do it manually...

Now I have a .text file, which each line is sorted alphabetically and saved and I need to copy and paste each time I update the html file.

How would I delete the full
Code:
<li class="invalid nav-item"><a href="Party 1.html">Party 1</a></li> .... (all list)
within the html and call the text file which would have all text, about 1000, then when I add more text to the list it would update the list within the code section...

Don't know if it makes sense... but here is an example:

What is now:
Code:
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for title..">

<ul id="myUL">
<li class="invalid nav-item"><a href="Party 1.html">Party 1</a></li>
<li class="invalid nav-item"><a href="Party 2.html">Party 2</a></li>
...
...
</ul>

Then Party 3 and 4 needs to be added so when the .text file is updated the new code and list will be updated to:

Code:
<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for title..">

<ul id="myUL">
<li class="invalid nav-item"><a href="Party 1.html">Party 1</a></li>
<li class="invalid nav-item"><a href="Party 2.html">Party 2</a></li>
<li class="invalid nav-item"><a href="Party 3.html">Party 3</a></li>
<li class="invalid nav-item"><a href="Party 4.html">Party 4</a></li>
...
...
</ul>

Would this be done easily with html and using css?
 

Theme customization system

You can customize some areas of the forum theme from this menu.

  • Wide/Narrow view

    You can control a structure that you can use to use your theme wide or narrow.

    Grid view forum list

    You can control the layout of the forum list in a grid or ordinary listing style structure.

    Picture grid mode

    You can control the structure where you can open/close images in the grid forum list.

    Close sidebar

    You can get rid of the crowded view in the forum by closing the sidebar.

    Fixed sidebar

    You can make it more useful and easier to access by pinning the sidebar.

    Close radius

    You can use the radius at the corners of the blocks according to your taste by closing/opening it.

  • Choose the color combination that reflects your taste
    Background images
    Color gradient backgrounds
Back