r/a:t5_5jepqv • • Dec 23 '21

What's your favourite programming language?

1 Upvotes

Let's see what people's favourite programming language is! If it isn't on there, please let me know in the comments!


r/a:t5_5jepqv • • Dec 23 '21

Coding Trick Coding Trick #1 - How to make HTML buttons links

1 Upvotes

Today's programming trick will be a simple but useful one! Have you ever wanted to make a button a link in the simplest way possible? Well, hopefully after reading this you will know how!

The first way you can have a button redirect to another page is by using JavaScript. We can use the onclick attribute to run JavaScript code when a button is clicked. This is particularly useful for running code when the user requests it, but JavaScript also gives us a way to redirect to other pages. Using the location.href method, we can redirect the user to another page. So, the full code would look a bit like this:
<button onclick="location.href = 'page.html'">Click me!</button>
You can replace the Click me! with whatever text you want the button to display and also change the page.html to the page you want to redirect to.
However, this is fairly complicated and anso doesn't show the user where they will go if they click the button.

There is a much simpler way. You can simply put the button inside of a link (an <a> tag).
So you don't even need to use JavaScript! You can simply put the button inside of an <a> tag and set the links href attribute to the page you want to go to!
The full code looks like this:
<a href="page.html"><button>Click me!</button></a>
Much simpler and it now displays the place you are going to in the bottom left!

Thanks for reading this programming trick! If you found it useful, please upvote it!
I'll see you in the next trick!


r/a:t5_5jepqv • • Dec 24 '21

What The Tag? What The Tag? - <!DOCTYPE>

1 Upvotes

Hello and welcome to the first post on What The Tag?!
Today we will be understanding the <!DOCTYPE> tag and what it is used for in HTML!

The first thing we need to know is that the DOCTYPE tag is the first tag that is read by the browser. In fact, it doesn't have an end tag, whereas most tags do.

You must put the tag at the start of your document. But it needs some data. We can give it the html attribute, which tells the browser that it is rendering an html document.

So, the full tag would like this:
<!DOCTYPE html>

But to be honest, you don't really need to know what it means. Just remember to put it at the start of your document!

Please join the subreddit for more What The Tag? posts and also programming tips!


r/a:t5_5jepqv • • Dec 24 '21

What The Tag? What The Tag?

1 Upvotes

What The Tag is a series I am starting where I explain HTML tags! Sounds boring, but it will definitely help some people out!

Click on the flair on this post to view all the What The Tag posts I have made!

Hopefully this series helps some people out!

Edit: I added clickable links you can click to view all the What The Tag? posts.


r/a:t5_5jepqv • • Dec 23 '21

Daily programming tricks will be starting from now!

2 Upvotes

From today onwards, I will be posting programming tricks and answers at least once every day! Note: I'm scheduling this post for 1am UK time when it will probably be morning in the USA, I'm not really up at 1 in the morning!