1

I have Category list sidebar and I want to make it sortable up and down, also remove one list of them with bottom. Here is image: example

HTML CODE:

 <div class="side-nav-categories">
    <div class="title"><strong>Category</strong></div>
    <ul id="category-tabs">
        <li><a href="javascript:void" class="main-category"> Web Applications<i class="fa fa-minus"></i></a>
            <ul class="sub-category-tabs">
                <li><a href="javascript:void">HTML</a></li>
                <li><a href="javascript:void">CSS</a></li>
                <li><a href="javascript:void">SCSS</a></li>
            </ul>
        </li>
    </ul>
    <ul id="category-tabs">
        <li><a href="javascript:void" class="main-category">Script<i class="fa fa-minus"></i></a>
            <ul class="sub-category-tabs">
                <li><a href="javascript:void">Javascript</a></li>
                <li><a href="javascript:void">jQuery</a></li>
                <li><a href="javascript:void">Angular JS</a></li>
            </ul>
        </li>
    </ul>
    <ul id="category-tabs">
        <li><a href="javascript:void" class="main-category">Server Script<i class="fa fa-minus"></i></a>
            <ul class="sub-category-tabs">
                <li><a href="javascript:void">C#</a></li>
                <li><a href="javascript:void">PHP</a></li>
                <li><a href="javascript:void">ASP.Net</a></li>
            </ul>
        </li>
    </ul>
    </div>
2
  • What have you tried? What exact problem are you having? Commented Mar 4, 2022 at 17:10
  • It would be great if you could upvote my answer :) Commented Apr 21, 2022 at 16:50

1 Answer 1

1

You can grab the element from its id:

document.getElementById(**yourId**).innerHTML = 'Realtime';

The above line just changed the value inside an element in realtime, using JavaScript. Keep in mind though, that you don't need to use innerHTML, you can use any JavaScript attribute that you want.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.