Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorMitij
    • CommentTimeMay 29th 2008
     permalink
    Is it possible to change, with just a regular link, de content of a div? And how do I do that?
  1.  permalink
    It is, if your users have Javascript enabled. That might not always be the case, though.

    A very crude way of doing so might look something like this:

    <div id="change">
    <p>one</p>
    </div>
    <a href="#" onclick="document.getElementById('change').innerHTML = '<p>two</p>';return false;">click!</a>


    That'll give you a div with "one" inside. Once you click the link, it will change to "two". The getElementById refers to the ID of the div, and the return false; prevents the browser from following the link.

    Is this what you are looking for? There are more elegant ways of doing this, and I'd much rather provide a proper example.
    • CommentAuthorkesav
    • CommentTimeMay 29th 2008 edited
     permalink
    Your question is not clear... Any how - from my understanding... Using CSS alone, you cannot change text content of a div with a link. Instead you can give a feel of the change by hidding and showing two different div tags.
    • CommentAuthorMitij
    • CommentTimeMay 29th 2008
     permalink
    Hmm, the way of patila might work, if i didn't have flash-buttons... -_-'
    Maybe it 's very important, but my menu is made in flash
    And I would like more something like kesav is saying, hiding and showing buttons.. Doesn't have to be with CSS alone.. But of course, it's made in Flash, extra difficulty
Add your comments
    Username Password
  • Format comments as (Help)