Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #36849

Re: How to make on-clickable div text look clickable

From James Harris <james.harris.1@gmail.com>
Newsgroups comp.lang.javascript
Subject Re: How to make on-clickable div text look clickable
Date 2019-06-08 19:25 +0100
Organization A noiseless patient Spider
Message-ID <qdgui8$vsa$1@dont-email.me> (permalink)
References <qdg0hs$kmc$1@dont-email.me> <qdgetl$13lc$1@gioia.aioe.org>

Show all headers | View raw


On 08/06/2019 14:58, R.Wieser wrote:
> James,
> 
>> do you have a preferred way of making that text look clickable?
> 
> As a reader ?   I would want to have it look like the real thing.  You know,
> underlined and with a certain color.

Well, here's a page with standard links. What it has in common with what 
I intend for this application is that it has a short clickable piece of 
text per line.

   http://pensites.com/politics/article/

In that, clicking on a line of text links to a page.

In what I want to do now, however, each line of text would be a 
question, and clicking on it would bring up the answer below.

I mention it purely because I think it illustrates that in that form the 
default formatting for links isn't too pretty.

> 
> As a writer ?  I would probably use the "a" tag itself, setting the "href"
> property to "javascript:your_function()".  You know, letting the tag handle
> all the nitty-gritty of making the text look clickable.
> 
> https://stackoverflow.com/questions/7347786/html-anchor-tag-with-javascript-onclick-event?rq=1
> 
> Than again, I often go for the easiest solution (after having spend quite
> some time googeling and testing what the easiest solution might be :-) ). >
>> I should say I am not sure it would be good to use /all/ the browser's
>> default formatting for this case
> 
> In that case you will most likely confuse and (sooner rather than later)
> annoy the user, which expects a certain uniformity.
> 
> But you can ofcourse also go for Stefans suggsetion, and not change the text
> itself but putting it on a button.   Or maybe just a small button (with the
> letter "A" - for Answer - in it) at the end of the question.

Good points. Some people have a flair for styling. Unfortunately, I am 
not one of 'em!


-- 
James Harris

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to make on-clickable div text look clickable James Harris <james.harris.1@gmail.com> - 2019-06-08 10:52 +0100
  Re: How to make on-clickable div text look clickable Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-08 12:14 +0200
  Re: How to make on-clickable div text look clickable "R.Wieser" <address@not.available> - 2019-06-08 15:58 +0200
    Re: How to make on-clickable div text look clickable James Harris <james.harris.1@gmail.com> - 2019-06-08 19:25 +0100
      Re: How to make on-clickable div text look clickable Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-08 20:42 +0200
      Re: How to make on-clickable div text look clickable "R.Wieser" <address@not.available> - 2019-06-09 10:02 +0200
  Re: How to make on-clickable div text look clickable James Harris <james.harris.1@gmail.com> - 2019-06-08 19:17 +0100
    Re: How to make on-clickable div text look clickable Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-06-08 20:40 +0200

csiph-web