-1

i am developing a website. I want to add a tag system to the blog/posts i make on my website and I'd like to know how. The specification of "only html, css and js" is because this is going to be a neocities website and neocities only accepts those three languages on the websites hosted there. No php or sql. I don't have much so far but i already made a search bar:

<form class="searchBar" action="">
    <input type="text" placeholder="Search..." name="search">
    <button type="submit"><img src="../img/logo_search.png"></button>
</form>

Thanks to anyone who has the answer!

  • Hi, you have an extremely low score (1) so I'd like to know if you have used html, css and javascript before or are you just literally starting out? – deemyBoy Oct 21 '22 at 00:44
  • Btw the I quickly goog'ed _neocities tags on pages_ and got [this](https://flipfall.com/how-to-switch-tags-on-your-neocities-account/) result so...maybe they have this type of feature already built-in? – deemyBoy Oct 21 '22 at 00:49
  • I'm still studying and i am a very amateurish dev, so yes, i am just starting out. – Eva Gabund Oct 21 '22 at 00:59
  • And the neocities tag you've looked for isn't really the type of tag i am talking about, I'm talking about adding tags to any post i make on my website, and i have a search bar that would be able to search those tags on my website – Eva Gabund Oct 21 '22 at 01:01
  • tags are not usually searched for, they are usually clickable links that bring related posts and topics together which is kind of what you're trying to do I'm guessing. You can working examples of this right here on SO such as the tags on the bottom of your/this question [javascript, html, css, search, tagging]. – deemyBoy Oct 21 '22 at 01:13
  • I could be completely wrong of course – deemyBoy Oct 21 '22 at 01:22
  • What I'm thinking about when i say i want to add rags to my posts is to do something like on Tumblr, where you can tag your posts there and people can search for keywords and tags on your profile and on your website ^_^ – Eva Gabund Oct 21 '22 at 02:29
  • And yeah, what you said is correct. I'm a amateur with programming but i managed to make something satisfying for my website and i wanted to add this feature too – Eva Gabund Oct 21 '22 at 02:30
  • That's great, really well done for having a go and learning something new. I've been trying for a few years now and still googling over 100 times a day because I don't know everything. – deemyBoy Oct 21 '22 at 14:04

1 Answers1

-1

JS is what you want to write that kind of logic in, you would need a function that searches for tags and a tag identifier like #. this function should get you started.

someString.split(' ').filter(v=> v.startsWith('#'))
K i
  • 539
  • 5
  • 12
  • Thanks! I also want to add a search feature that can search for tags, do you have any tips of how i can do that? – Eva Gabund Oct 22 '22 at 14:58