Paul Lopez, a minor 7 years of age, was injured when he climbed upon and fell from a scaffolding erected upon a public sidewalk. The accident occurred while the defendants were doing certain remodeling on the first story of a 10-story office building located on the corner of Fulton and Fresno Street in downtown Fresno. In this action for damages general demurrers were sustained to the complaint and to three amended complaints, all with leave to amend. The plaintiff then refused to further amend and a judgment of dismissal was entered, from which the plaintiffs have appealed.
 It was alleged, in the first cause of action, that in doing this remodeling the defendants erected upon the adjacent sidewalk a scaffolding of such a nature as to be attractive to young children as a plaything for them to climb upon; that the defendants knew or should have known "that young children pass along and upon said public sidewalk," and would be attracted to and likely to climb over and upon said scaffolding, and likely to fall from it or injure themselves; that the defendants negligently failed to completely enclose said scaffolding, but left openings of 8-10 feet in width along a wooden partition erected on said sidewalk, although said scaffolding could be enclosed without affecting its use; and that this accident occurred on a Saturday afternoon when no work was being done by the defendants, and when those openings in the partition were not being used.
It is then alleged that said scaffolding "was of a novel and unique character and not a common contrivance whose dangers were recognizable to children," and was attractive to children of this age; that this scaffolding consisted of tubular pipes in a perpendicular position but at a slight angle, with "horizontal cross bars of pipe every two feet or thereabouts, the entire contrivance closely resembling the `monkey bars' or climbing devices found in public playgrounds for children"; that said scaffolding could be seen from the portion of the sidewalk used for passage of the public, through the openings in the board partition, and said "open partitions" constituted an invitation to children of this age to enter and climb upon the scaffolding; that said scaffolding contained hidden and unrecognizable dangers to children of this age since loose planks 12 feet long 2 inches thick and 10 inches wide were placed on top of the scaffolding at a distance of 10 or 12 feet above the ground; that these planks were placed in an overlapping manner, one over the other, with no support in the middle and no means of securing the planks to the scaffolding at the point where they overlapped; and that as a result said planks, although giving the appearance of being strong and secure were in fact loose, wobbly, insecure and dangerous, all of which was or should have been known to the defendants.
It was then alleged that on this occasion Paul Lopez walked along and beside said scaffolding, and was attracted by the openings mentioned and by this scaffolding; that he "did enter and climb upon said scaffolding to play and in doing so did fall from said loose, wobbly and insecure boards on said scaffolding, a distance of approximately 12 or 15 feet, landing upon the cement pavement in such a manner as to cause severe and permanent injury" to his left arm; and that all of this was the direct and proximate result of the negligence of the defendants as above alleged.
A second cause of action repeated by reference all of the allegations of the first cause of action and, in addition, alleged that in conducting this remodeling work the defendants had violated a city ordinance by leaving these openings in the fence in front of said scaffolding unprotected by any "closed doorways." A copy of portions of this ordinance, being a part of the Uniform Building Code, is set forth in the complaint. The portion set forth is entitled "Chapter 44 — Protection of Pedestrians During Construction or Demolition." The first section provides "No person shall perform any work on any building or structure, if by so doing he endangers pedestrians on the street that abuts the property line, unless the pedestrians are protected as specified in this chapter." Another section relates to "Protection of Pedestrians on Public Property." It provides for the erection of fences, under certain conditions, and that doorways may be cut in the fence if they are protected by doors and kept closed except when opened to permit materials or persons to pass through.
The appellants contend that the third amended complaint was sufficient to set forth a cause of action under the attractive nuisance theory, and that the court erred in sustaining demurrers thereto. While it is admitted that in some cases a court may declare, as a matter of law, that the instrumentality in question is not an attractive nuisance it is argued that this is generally a question for the jury and that, under the decision in Clark v. Pacific Gas & Elec. Co., 118 Cal.App. 344 [5 P.2d 58, 6 P.2d 297], it should be held that here the question was one of fact for the jury. In that case the boy was not injured because he fell from the pole but because he touched an electric power line, which constituted a novel and hidden danger which was not obvious to the boy and which, in effect, constituted a trap. Moreover, the order of the then Railroad Commission which the defendant had violated was one the obvious purpose of which was to prevent any unauthorized person from climbing the pole and coming in contact with such wires.
 It is well established, as an exception to the general rule that the owner of property owes no duty to mere trespassers to keep the property in a safe condition, that where an attractive contrivance is maintained with the knowledge of the owner, which is alluring to children and inherently dangerous to them, this may constitute negligence out of which liability will arise for injuries resulting from such neglect.  There is no dispute here as to the general principles governing the applicability of the doctrine. Its application in a particular case must depend upon the circumstances there appearing. Some of the difficulties in deciding the question of the applicability of the doctrine, and some of the principles and facts to be considered, are pointed out in many cases in this state, including Puchta v. Rothman, 99 Cal.App.2d 285 [221 P.2d 744] and Marino v. Valenti, 118 Cal.App.2d 830 [259 P.2d 84]. The doctrine has been applied in cases where hidden dangers exist which would be outside the experience of young children, including cases involving drowning under certain conditions, access to dynamite or dynamite caps, movable machinery, high tension wires, and boards piled near where children play, in a manner that is inherently unsafe. Thus far, the doctrine has never been applied in a case involving only an opportunity to climb upon something, the danger of falling being something that is known and realized to all children from earliest infancy, or in a case involving a mere attraction to something as an opportunity to play. In Loftus v. Dehail, 133 Cal. 214 [65 P. 379], the court said:
"But it by no means follows, ... that anything or everything which a jury may find, or a court may determine, to be attractive as a playground or plaything for children casts a responsibility of guard and care upon the owner of that thing.... Venturesome boys, and even girls, make playgrounds of unfinished buildings, climb perilous heights, and scamper over insecure boards and rafters. If an owner became responsible, merely because children were attracted, it would burden the ownership of property with a most preposterous and unbearable weight."
In Doyle v. Pacific Elec. Ry. Co., 6 Cal.2d 550 [59 P.2d 93], the court said:
"But it is not every contrivance or apparatus that a jury will be entitled to treat as an `attractive nuisance.' Before liability may be imposed, always there must be something in the evidence tending to show that the device was something of a new or uncommon nature with which children might be supposed to be unfamiliar, or not to know of its danger.... There is nothing uncommon about a ladder. They are present in practically every home or house, and the danger of falling from them is familiar to children as well as to adults. The ladder was dangerous, but it was not uncommon, and in this case it was not a proximate cause of the injury."
 Under the cases just cited, and Giddings v. Superior Oil Co., 106 Cal.App.2d 607 [235 P.2d 843], it appears that in some cases it may properly be held, as a matter of law, that the attractive nuisance doctrine is not applicable, and that the facts are not sufficient to warrant leaving the decision of that question to a jury.  In general, it may be said that the cases where the doctrine has been applied have been cases where with the owner's knowledge children of tender years habitually come on his property to play, when a dangerous condition exists there which involves an unreasonable risk of harm to such children, or where there is an unknown concealed danger or contrivance which constitutes a trap, the existence of which the child could not be expected to suspect.  The applicability of the doctrine involves the elements of lure to children, the forseeability of their playing on property where an unreasonable risk of harm exists, and the presence of a concealed or unknown danger. It involves whether the defendant should have anticipated that an injury would be apt to result from his failure to do something which the circumstances reasonably required, as distinguished from something that resulted only from the child's own activity.
The conditions which are required to make the doctrine of attractive nuisance applicable, as recognized by the decisions in this state, are briefly stated in section 339 of the Restatement of Torts, as follows:
"1. The place where the condition is maintained must be one of which the possessor knows or should know that such children are likely to trespass.
"2. The condition must be one of which the possessor knows or should know and which he should recognize as involving an unreasonable risk of harm to such children.
"3. The child because of his immaturity either does not discover the condition or does not appreciate the danger involved.
"4. The utility to the possessor of maintaining the conditions must be slight as compared with the risk to the children involved."
 We think that all of these required conditions were not sufficiently met by the allegations of this complaint. The place was at one of the two busiest intersections in downtown Fresno. Traffic is heavy at all times, especially on Saturday afternoons. It would not normally be expected that children would play there. While, as alleged, it was to be expected that young children would pass along the adjacent public sidewalk or the portion kept open for that purpose, it was to be expected that this would be for the purpose of going to some other destination and not for the purpose of playing in that area. This is especially true of younger children who, at such a place, would usually be accompanied by an older person. Under the circumstances it was hardly to be expected that children would leave the partitioned walkway, enter the enclosure, climb up 12 feet and walk on the planks placed there for use of the workmen. It is not claimed that such a thing was known to have occurred before, and it seems unreasonable to hold that small children were likely to trespass in the manner alleged under the circumstances as they existed at the time.
 Nor do we think the existing condition was one which the respondents should have recognized as involving an unreasonable risk of harm to such children. There was nothing unusual or uncommon for such a place while building operations are in progress. There was nothing to attract children except a possible opportunity to climb, which is present almost anywhere. While a scaffold may be attractive to a child as a place to climb it is not a device which is new or uncommon, or something with which children should be supposed to be unfamiliar. It involves the usual danger from climbing but there is no novel or hidden danger with which a child would be unfamiliar. While it has some resemblance to a ladder, that is something with which children are familiar. This was a solid frame, with heavy planks suitable for men to work upon. It is not alleged that there was any slipping or tipping of these heavy planks, and the only danger was the usual chance of falling. There was nothing to have indicated that an unreasonable risk to children existed, especially at a point where children would not normally be expected to come on the property or to play in that area. The allegation that the planks were wobbly and insecure, in view of the other allegations as to the way in which they were placed, is not sufficiently substantial to distinguish this case from the ordinary climbing case. Even if the respondents should have known that a child might enter and climb on this scaffold they would not normally think of this as an unreasonable risk, as distinguished from the ordinary risk of climbing. Children climb on all sorts of things, usually without harm, and it would be impossible to guard against this, or the possibility of falling which always accompanies it, in most of the situations where an opportunity for climbing presents itself.
 It can hardly be said, in reason, that this child was too young to appreciate the danger involved. From the time they are born all children realize the danger of falling and instinctively clutch at something when they feel that danger is near. While the instinct to climb is practically universal, and it is carried on in a venturesome spirit, a consciousness of the risk of falling is always present. Beyond question, the minor plaintiff when climbing this scaffold knew that there was a risk of falling if he was not careful, knew that if he slipped he would fall, and knew that if he fell he might hurt himself. He was injured by a danger, the risk of falling, of which he was conscious when he started to climb. The respondents should not be expected to know, aside from other considerations, that any child would not realize such danger as is inherent in any climbing, or that he would not discover when he reached the top of the scaffold that these planks were narrow and that some danger of falling was involved in walking on them.
 Insofar as the comparison between the utility of the scaffold and the risk to children necessarily involved is concerned, the cost of complete fencing and the inconvenience of maintaining it is not slight but is apparently greater than the risk to children that was reasonably to be expected. If, in considering the applicability of the attractive nuisance doctrine, it should be held that this scaffold should have been completely enclosed it would naturally follow that all such scaffolds must be so enclosed. This would be unreasonable as these scaffolds are commonly used and seen on the sidewalks of all cities, often where small repairs or improvements are being made upon business buildings. They are frequently used in painting and other work where they have to be moved frequently, often several times in one day. It would be impractical and unduly burdensome to require complete enclosure in all such cases, and it should not be required in this instance insofar as that element or condition of the attractive nuisance doctrine is concerned.
The claimed violation of a city ordinance, which is included in the second cause of action, does not change the situation or relieve the appellants from the burden of bringing themselves within the attractive nuisance exception to the general rule. The appellants concede in their briefs that this matter "must be considered in conjunction with the attractive nuisance doctrine and not separately."  It is well settled that the violation of a statute or ordinance is actionable negligence only as to those persons for whose benefit or protection it was enacted. (Nunneley v. Edgar Hotel, 36 Cal.2d 493 [225 P.2d 497]; Satterlee v. Orange Glenn School Dist., 29 Cal.2d 581 [177 P.2d 279].) The complaint does not allege just what work was being done at the time in question, and it does not too clearly appear therefrom that this ordinance was being violated.  Assuming that it was, it clearly appears that the harm intended to be prevented by the ordinance was injury or inconvenience to pedestrians lawfully using the sidewalk. As a trespasser the minor plaintiff was not one of the class of persons whom the ordinance was intended to benefit, and there was no causal connection between the violation of the ordinance and the injury. The ordinance added nothing to respondents' duty insofar as the duty to trespassers is concerned. Any such duty must depend on the attractive nuisance exception to the general rule, and a violation of the ordinance, if any, was not a proximate cause of the injury. Regardless of the ordinance or any violation thereof the appellants must bring themselves within the requirements of the attractive nuisance doctrine. When all of the elements of the doctrine are not present, there is no duty to so enclose the property that such a trespass is impossible.
Negligence is relative to time, place and circumstances, and the question here is as to what was the duty of the respondents and as to what they should have foreseen in view of the knowledge which the complaint charges them with possessing. (Katz v. Helbing, 205 Cal. 629 [271 P. 1062, 62 A.L.R. 825].) We cannot agree that reasonably prudent persons would, under the circumstances alleged, have realized the necessity of taking steps to prevent the possibility of a small child climbing on this scaffold. If any other facts existed which would tend to bring the appellants within the exception to the general rule they had an ample opportunity to allege them.
The judgment is affirmed.
Griffin, J., and Mussell, J., concurred.
A petition for a rehearing was denied May 14, 1956, and appellants' petition for a hearing by the Supreme Court was denied June 20, 1956. Gibson, C.J., and Carter, J., were of the opinion that the petition should be granted.