Home › Forums › JavaScript › Javacript Novice
- This topic is empty.
-
AuthorPosts
-
May 30, 2016 at 4:05 am #242246
web_junkie
ParticipantFirst of all i want to recommend your works and efforts towards making everyone equal in the sense of offering assistance.
I came across this site as i was reading a book on css animation and transition. I just decided to follow the link if i could get more css tutorials and tips little did i know that this site has solution to my problem.
Sincerely, i started learning web develpment some months ago but am stuck with this language called javascript. I have read and watched tutorials but that’s the more confused i became…
Please can someone help explain how i link my div id or div class to this javascript stuffs… Thanks in anticipation….
May 30, 2016 at 6:47 am #242248Senff
ParticipantYou’ll need to be a little more specific about what you want, really. “Link my div to Javascript stuffs” doesn’t really mean much.
But then, when we would explain something to you, the key is to actually understand it. And that’s where basic Javascript knowledge comes in, so watching/reading tutorials is still important!
May 30, 2016 at 9:08 am #242251web_junkie
Participant@Senff, thanks for your reply. The truth is i don’t seem to understand the javascript. the more i try to understand the hell it becomes..
May 30, 2016 at 9:17 am #242252Shikkediel
ParticipantWhat would you like to achieve? It is merely purpose driven. Any HTML elements in your page can be manipulated with JS… in countless ways. But you must have some reason for it.
May 31, 2016 at 10:35 pm #242309web_junkie
ParticipantI find it hard understanding javascript… dunno why it’s like that..
Just need a suitable material that explains it better..
June 1, 2016 at 7:16 am #242323bearhead
ParticipantI find that I learn programming languages most efficiently by doing.
Start with a small project and build from there.
Maybe something like this:create a script that changes the text of a button when the user clicks it.
To do that you’ll need to know:
How to select an html element in javascript
How to call a function on click
How to change the inner html of an elementoff to google with you!
June 1, 2016 at 11:00 am #242331amanda_
ParticipantYou’ve been learning for a few months?? get a good handle on HTML and CSS for a few more months and then try Javascript.
June 3, 2016 at 5:34 pm #242453web_junkie
ParticipantThanks… just decide to leave javascript and concetrate more on css and html..
it seems php is a lot easier than javascript…
@AMANDA… thanks ma’amJune 4, 2016 at 8:54 am #242455rkieru
ParticipantWhile I agree with everyone else in that you would benefit on firming up your fundamentals on HTML/CSS before trying to tackle Javascript, I would advise you to eventually look up “Selectors”, as that is the terminology that you are looking for regarding how to have Javascript interact with specific Classes and IDs.
For example, in jQuery it might look like this:
$(".btn-action").hide();
In jQuery, this would take all instances where the class
.btn-action
was applied and hide that element.June 4, 2016 at 9:09 am #242457I.m.learning
ParticipantPHP is only going to get you so far.
You seem to know that PHP is server-side; you need to provide it for your users when the page loads. JavaScript is built into the browsers and are mainly client-side that can be run after a page loads.If you require something that is to be run after a page loads; PHP fails every time. Most JavaScript are pre-written, you just need to call upon those codes.
JavaScript has a library called JQuery in which we can download it to our local environment, or link to it through various sources.
Many sites use
https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js”As Shikkedielsaid, “it’s purpose-driven.”
Meaning, what are you looking to do?
What do you do with your PHP?How about an example for both- for the time:
PHP you do what, create a variable, and use some code? Okay..
<?php
$t=time();
echo($t . “<br>”);
echo(date(“Y-m-d”,$t));
?>So, as soon as the page loads, it’s there.
But what if you don’t want the time to be displayed as soon as the page loads?
What if we want the user to initiate it, at their own discretion? Well, that’s where JavaScript comes in. Let’s create a button the user clicks to initiate the code<button type=”button”
onclick=”document.getElementById(‘time).innerHTML = Date()”>What’s the Time?</button>As soon as the user clicks the button, the time is displayed.
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.