Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 3 years ago

Ping Subscribe Section using Js

Kristiana12•425
@Kristiana12
A solution to the Ping single column coming soon page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Hey all! This is my solution to the Ping Challenge. Would really love some feedback! :)

Especially on the email validation part, how do you validate if the email the user inserted is valid or not? Thank you in advance and happy Coding!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Raymart Pamplona•16,040
    @pikapikamart
    Posted over 3 years ago

    Hey, awesome work on this one. Just saw the site and the desktop view looks really nice and the mobile state as well. For the media query, I suggest maybe lowering it down because right now, at 0px-1000px, it is already showing the mobile state. Though it is just a minor change on the overall design, the breakpoint still is too big and you can just make the layout scale with the screen-size so that you could make less the media query.

    For some other suggestions, here are some:

    • Avoid using id to target and style an element since it is a bad practice due to css specificity. Instead, just use class to target element.
    • Remember that a website-logo is one of the meaningful images on a site so use proper alt for it. Use the website's name as the value like alt="Ping".
    • When using img tag, you don't need to add words that relates to "graphic" such as "logo" and others, since img is already an image so no need to describe it as one.
    • Upon looking at the current primary landmark, I saw that you used section tags outside the main. Typically, you will only see this markup on a site:
    <header />
    <main />
    <footer />
    

    As the primary landmarks and all other elements are inside in their respective landmark. For example, the success message and the hero-section image should all be inside the main tag, since those contents are the main-content of the site.

    • Your input right now currently lacks associated label to it or an aria-label to which will define the purpose of the input element. Always include it so that user will know what they need to give on each input. Make sure that label is pointing to the id of the input as well.
    • Currently, the error-message is only seen visually and not really connected or linked on the input properly. A proper way of linking error-messages to their input looks something like this:
    if ( input is wrong )
      input.setAttribute("aria-invalid", "true");
      input.setAttribute("aria-describedBy", id of the error-message);
    else 
      input.removeAttribute("aria-invalid");
      input.removeAttribute("aria-describedBy");
    

    The error-message element should have an id attribute which is referenced by the aria-describedBy attribute on the input element. By doing that, your user will know that the input is wrong because of aria-invalid and they will know what kind of error they made because of the aria-describedBy.

    • The "notify me" should be a button and not an a tag. Remember that an a tag serves to direct a user in another page since it is a link, while a button controls something and on this one, button should be used since it will "submit" the form. Use type="submit" attribute on the button on this one.
    • Also, if you like, I have this simple accessible form which you can reference. aria-live is implemented as well so that user will be informed right away on what is the current status. Let me know if you have any queries:>
    • For the hero-section, it could use a more descriptive alt value and like what I said, avoid words like illustration. On this one, you could use something like alt="Ping application's user dashboard".
    • When you are using section make sure that it has an heading tag inside it that is being labelled to the section itself. section tag is not really informative even if it is being treated as landmark unless it is using aria-labelledby. For this one, you can just use div to wrap the image.
    • For each of the social-media links a tag, you don't need to use the words redirected since an a tag is already a link and it will be announce as a link to the user. You can just use the social-media name as the aria-label and that would be enough.

    Aside from those, great job again on this one.

    Marked as helpful
  • Nam HaÏ•820
    @Nam-Hai
    Posted over 3 years ago

    Nice work !! Good use of the input type to handle e-mails.

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub